how to take screen shot in blue prism without using exception stage

Sachin_Kharmale

Active Member
Hi @gunadmtdomains ,

If u want to take a screen shot without using exception stage use bellow code it will take screen shot of your screen and save it on local drive.
Code:
string Error="";
try
{
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
Clipboard.Clear();
Clipboard.SetImage(printscreen);
printscreen.Save(@"D:\\ScreenShot.jpg",ImageFormat.Jpeg);
Success=true;
}catch(Exception e)
{
    Success=false;
    Error=e.Message;
}
ErrorMessage=Error;
I hope it will help you..!
 
I use this one made in vb
Code:
Dim area As Rectangle
Dim capture As System.Drawing.Bitmap
Dim graph As Graphics

area = My.Computer.Screen.Bounds
capture = New System.Drawing.Bitmap(area.Width, area.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph = Graphics.FromImage(capture)
graph.CopyFromScreen(area.X, area.Y, 0, 0, area.Size, CopyPixelOperation.SourceCopy)
FullSavedScreenshotPath = OutputFolderPath & OutputFileNameWithoutExtension & ".jpg"
capture.Save (FullSavedScreenshotPath, System.Drawing.Imaging.ImageFormat.jpeg)
ScreenshotImage = capture

inputs:
OutputFolderPath, OutputFileNameWithoutExtension

outputs:
ScreenshotImage, FullSavedScreenshotPath
 

Jagadeesh02

New Member
how can i capture or screen shot after launch or open my excel file.

Take a screenshot of the email body and paste that attachment on excel sheet
 
Last edited:

Sachin_Kharmale

Active Member
Hi @Jagadeesh02 ,

If you want to take screen shot of excel file once it will open.

you need to use action show workbook and then call above code stage to take screen shot of open excel document.

I hope it will help you..!
 
Top