hi,
I am able to get form icon using form.Icon property... to compare this retrived icon cannot find any api.
FindImage and CompareImage methods returns false for title bar icon as point value is not set.
Could you please suggest me the solution for this?
Validating icon of titlebar in form
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
First of all you need to save the icon as a bitmap (see System.Drawing.Icon.ToBitmap method). Then you can use the CompareImage and FindImage methods of the form with the bitmap. You can calculate the offset for the CompareImage method by using the FindImage once.
The only thing with icons is that you need to consider transparent areas. When saving icons as a bitmap, these transparent colors will be replaced with a default color, so the transparency gets lost. So, if your form icon hast transparent areas, be sure to crop those areas with an image editor first.
Regards,
Alex
Ranorex Support Team
The only thing with icons is that you need to consider transparent areas. When saving icons as a bitmap, these transparent colors will be replaced with a default color, so the transparency gets lost. So, if your form icon hast transparent areas, be sure to crop those areas with an image editor first.
Regards,
Alex
Ranorex Support Team