Kia1
(Ana)
April 18, 2024, 3:46am
1
I want to capture the screen of a website with the “Take Screenshoot” activity
The screenshot will be a “png” file and then I want the image to be immediately resized in width and height.
After that, it was saved to the image folder and given a file name according to the excel data that I had
I made a flow like this is it correct? but how to resize the height and width of the image?
hello @Kia1 ,
you can use HTML template to give size of your image
just we need to convert into ToBase64String.
"<img src=""data:image/jpg;base64,byte_stringVariable"""+"Width=""320"" height=""250"" " +"/>"
below screenshot is for your reference
lastly HTML_tag you can use in your templete.
i am attaching .xaml file for your reference
demo.xaml (8.0 KB)
Regards,
Dheerendra Vishwakarma
Kia1
(Ana)
April 18, 2024, 6:23am
3
Is this implemented after or before the take screenshot activity?
@Kia1
what i have done is i have placed images in local folder and used html template to give size
Kia1
(Ana)
April 18, 2024, 8:06am
5
I experienced an error in the byte_arr assignment section
ppr
(Peter Preuss)
April 18, 2024, 8:08am
6
We can do it by a flow like this:
here a formal specification on how the scaling / scalefactor is defined is recommended. But we can dynamic calculate it and also add to the implementation parts
Kia1
(Ana)
April 18, 2024, 8:23am
7
what is the “myImage” variable for?
ppr
(Peter Preuss)
April 18, 2024, 8:28am
8
Activating the Take Screenshot Activity and Pressing F1 brings us to:
The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...
and we can check:
which is a variable of DataType:
We recommend to have an understanding on what is done. Instead of:
Taking Screenshot - writing file - reading file - scaling file - writing scaled file
we just do:
Taking Screenshot - scaling file - writing scaled file
Kia1
(Ana)
April 18, 2024, 8:31am
9
Argument ‘Image’: BC30057: Too many arguments to ‘Public Overloads Function Scale(scaleFactor As Double) As Image’.
I experienced an error, the myImg variable was already of image type
then where do I give the image height and width values?
ppr
(Peter Preuss)
April 18, 2024, 8:38am
10
Kia1:
I experienced an error,
We recommend to check what is needed and expected within the functions
we mentioned but it was not answered
yourScaleFactor is of DataType double e.g. 0.75 = 75%, 0.45 …
As you gave too numbers, it was causing the factor.
So let us know in detail what is needed we can help on:
calculating the scalefactor (as mentioned and offered above)
checking for alternate scaling options
Kindly note: we recommend a proportional scaling. Does mean
do scale with the same factors on witdth and hight
Kia1
(Ana)
April 18, 2024, 8:44am
11
The original image size is Width: 960px Height: 450px
I want to change it to Width : 429px , Height : 201px
ppr
(Peter Preuss)
April 18, 2024, 8:59am
12
429 / 960 = 0.446875
201/ 450 = 0.4466
So we dont have a proportional scaling, but close as
450 * 0.446875 = 201.09375
So we can calculate the scale factor by
@Kia1 ,
what you have put in byte_arr assign
can you show me? so that we can help you
ppr
(Peter Preuss)
April 18, 2024, 9:06am
14
@Kia1
we recommend to focus 1 approach - implement it to end / success
And THEN explore alternates
But do not work on multiple approaches in parallel
@Dheerendra_vishwakarma
we don’t see a need of:
An UiPath.Core.Image gives us already the Base64 String by
1 Like
@Kia1
yes as @ppr is saying right just go for one approach then find the alternative way.
Kia1
(Ana)
April 18, 2024, 9:24am
16
I’ve fixed the robot running smoothly, but when I check the image size it doesn’t change
Should I change the part that I circled in yellow to my path name?
@Kia1
your image is in png format
try this if it work
"<img src=""data:image/png;base64,byte_stringVariable"""+"Width=""320"" height=""250"" " +"/>"
Regards
Kia1
(Ana)
April 21, 2024, 3:36am
18
Sequence2.xaml (10.0 KB)
I have a UiPath flow like this, is it possible without using the “For each file in folder” activity? because I already have my own loop.
what variables can I write to “load image”?
ppr
(Peter Preuss)
April 21, 2024, 2:28pm
19
We recommend scoping 1 Topic = 1 use case
The description from begin and the Flow from above are much different and we risk a ping-pong communication losing a straightforward progress to solution
we recommend not to ommit the loop over the files e.g. with black-boxing it with an invoke code.
However the part of:
can be condensed to
We do feel that the topic can be closed now:
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…