Page 1 of 1

Recognising picture control on a Dialog

Posted: Tue Nov 20, 2007 1:23 am
by vraju
I Use Ranorex C++.

I have a static picture control in a dialog. I would like to grab the Picture and store it for validation. How do I capture and save? Is this saved as .bmp?

Thanks,
Venkat.

Posted: Tue Nov 20, 2007 11:45 am
by Support Team
In C++ the only option is to get each pixel color from the screen or the corresponding device context, respectively, and then manually save these data to a file.

You can either use the RxPixelGetColor() method included in Ranorex or the native Windows methods GetDC(HWND) and GetPixel(HDC, int, int) to get the pixel colors at certain screen coordinates.

For .NET controls there will be an easier way provided by the next version of RanorexNet: this version will include the functionality to get or set the value of any .NET control property. This way you could get the Image property of a .NET PictureBox control and use the Image.Save method to save the image to a file.

Alex
Ranorex Support Team