Access Image in Repository

Ask general questions here.
db712
Posts: 2
Joined: Wed Jun 30, 2010 12:43 pm

Access Image in Repository

Post by db712 » Wed Jun 30, 2010 1:12 pm

I have some images in the repository.
How can i access from my programs those images?

When I use the Recorder there are additional images in the Recording1.cs.

Any Hint?

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

Re: Access Image in Repository

Post by Support Team » Wed Jun 30, 2010 2:59 pm

Hi,

You want to use the images in your code or in a specific recording?

Regards,
Peter
Ranorex Support Team

db712
Posts: 2
Joined: Wed Jun 30, 2010 12:43 pm

Re: Access Image in Repository

Post by db712 » Wed Jun 30, 2010 3:52 pm

I want to use it in my code.
I have small wrappers written
Something like
public static void Pro_Click()
{
Report.Info("Mouse Left Click item 'Pro' at Center.");
repo.LeftNavi.LeftNavi_Pro.Click(Location.Center);
}
or
public static void Pro_Zugeklappt_Validate()
{
 Report.Debug("Validating CompareImage (Screenshot: 'Pro_zugeklappt' with region{X=0,Y=1,Width=39,Height=13}) on item 'LeftNavi_Pro'.");
Validate.CompareImage(repo.LeftNavi_ProInfo, LeftNavi_Pro_zugeklappt, LeftNavi_Pro_zugeklappt_Options);
}			}
And both LeftNavi_Pro_zugeklappt and LeftNavi_Pro_zugeklappt_Options are generated within Recording1.cs
I could have those options in Code, but I would like to get that image direct from the repository.
I found that image in the xml file, but the generated code doesn't have this part of data.

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

Re: Access Image in Repository

Post by Support Team » Thu Jul 01, 2010 9:56 am

Hi,

Sorry but there is no way to get the screen shot from the repository. The only way to use a screen shot of your item is to generate it during runtime by code.
Bitmap myBmp = Imaging.CaptureCompressedImage(repo.yourElement);
Regards,
Peter
Ranorex Support Team