Recognising picture control on a Dialog

Class library usage, coding and language questions.
Posts: 5
Joined: Thu Jun 14, 2007 2:25 am

Recognising picture control on a Dialog

Post by vraju » Tue Nov 20, 2007 1:23 am

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?


User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Post by Support Team » Tue Nov 20, 2007 11:45 am

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.

Ranorex Support Team