Hello,
firstly let me show you what I already have. This might help somebody who want to know, how to save a panel as an image easily.
In my case, I save a picture with a transparent label over it as an image (bmp/jpg).
The image comes from other windows , where i used SampleGrabber to grab frames and save them to my harddisc ("C:\\example.bmp"). The label shows the current time of the computer.
label1->Text = Convert::ToString(System::DateTime::Now);
panel1->BackgroundImage = Image::FromFile("C:\\example.bmp");
System::Drawing::Rectangle rc = panel1->ClientRectangle;
Bitmap^ bmp= gcnew Bitmap(rc.Width, rc.Height);
this->panel1->DrawToBitmap(bmp, rc);
bmp->Save("C:\\ExampleJPG.jpg");
bmp->Save("C:\\ExampleBMP.bmp");
Dispose method for C++/CLI:
if (panel1->BackgroundImage!=nullptr)
delete panel1->BackgroundImage;
OK, now time for my problem:
1. the biggest problem is the quality of saved pictures. I can succesfully save the pictures. But I always get some gray points on them ("C:\\ExampleJPG.jpg" or "C:\\ExampleBMP.bmp"). Sometimes a lot, sometimes only three or four dots, sometimes there is no such things. I don't understand why. So should I make foto corrections? Or what else?
Could you give me advices?
2. another question: How can I change the resolution of the pictures? (Before or after they are saved.)
Any answer will be appreciated!