cancel
Showing results for 
Search instead for 
Did you mean: 

Picture.SaveToFile() - Remove Cursor from Image?

SOLVED
Occasional Contributor

Picture.SaveToFile() - Remove Cursor from Image?

Hi All,

 

I am trying to use picture.SaveToFile(fileName) to save a table image to a .PNG file. 

 

I need to have the cursor removed from the image, as this is causing the Picture diffing to fail.

 

My code - Python : 

 

CommonUnit.Delete_Files(local_image)     # delete any old image file

 

# move mouse out of the way

Aliases.Compass_for_SW.Main_ToolBar.Graph_Area.Composite.Level_1.Level_2.CTabFolder2.HoverMouse() 

Experiment_Table_Image.SaveToFile(local_image)      # save Experiment Table to png file

 

Jess_Test_2_ViewFilter_ShowHidden_Table.png

 

Any thoughts / Solutions?

 

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Picture.SaveToFile() - Remove Cursor from Image?

Hi,

 

Something like this:

// Move mouse out of view

Sys.Desktop.MouseX = Sys.Desktop.Width;

Sys.Desktop.MouseY = Sys.Desktop.Height / 2;

 

// Take a picture excluding mouse pointer

var pic = Aliases.Compass_for_SW.Main_ToolBar.Graph_Area.Composite.Level_1.Level_2.CTabFolder2.Picture(0, 0, -1, -1, false);

 

// Save picture to file

pic.SaveToFile(...);

 

Does it help?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

2 REPLIES 2
Community Hero

Re: Picture.SaveToFile() - Remove Cursor from Image?

Hi,

 

Something like this:

// Move mouse out of view

Sys.Desktop.MouseX = Sys.Desktop.Width;

Sys.Desktop.MouseY = Sys.Desktop.Height / 2;

 

// Take a picture excluding mouse pointer

var pic = Aliases.Compass_for_SW.Main_ToolBar.Graph_Area.Composite.Level_1.Level_2.CTabFolder2.Picture(0, 0, -1, -1, false);

 

// Save picture to file

pic.SaveToFile(...);

 

Does it help?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Occasional Contributor

Re: Picture.SaveToFile() - Remove Cursor from Image?

Thanks for your reply!

 

I found the Picture() function with the Mouse parameter just after I posted my question.  Works perfectly now!

 

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors