Capture images in Hypermesh with Image size
Hi,
Hypermesh has an API '*jpegfilenamed' to capture images. But, with this I am not able to control the size of the images. Is there any way to achieve this?
In Hyperview, we have an API ' CaptureScreenToSize' that enables us to capture images with different sizes. I am looking for a similar option in Hypermesh.
Thanks
Answers
-
Hi,
/emoticons/default_cool.png' title='B)' />write your own function, like this:
proc ::p_CaptureGraphic {Size {FilePath {}} {Center {}}} { lassign [hm_getgraphicsarea] x y w h lassign $Size W H lassign $Center Cx Cy if {[string equal '' $H]} {set H $W} if {[string equal '' $Cx]} {set Cx 0; set Cy 0} if {[string equal '' $Cy]} {set Cy $Cx} set X [expr $x+$w/2+$Cx-$W/2] set Y [expr $y+$h/2+$Cy-$H/2] if {[string equal '' $FilePath]} { hm_windowtoclipboard $X $Y $W $H } else { hm_windowtofile $X $Y $W $H $FilePath } } #example, copy a square 100x100 at center of graphic: p_CaptureGraphic 100 file1.jpg #copy 200x300 p_CaptureGraphic {200 300} file2.jpg #copy 50x50 near by right bottom corner (offset x100 y100 from center of graphic): p_CaptureGraphic 50 file3.jpg {100 100}
0 -
Thanks tinh.
This is a useful code where I can control the area of the screen that I want to capture.
Actually, I want to capture the entire HM graphics screen and then control the size of the resulting image. So, anyway I can do that?
0 -
Do you mean you want to zoom in/out ?
0 -
No, I dont want to zoom.
Say, if my '*jpegfilenamed' API captures image with size 1162*722. I want the same image to be resized to 722*722, so that I can easily populate them in my Powerpoint presentations.
0 -
I understand,
You want to crop the image, dont you?
Because otherwise it is stretched/collapsed similar to zooming
0 -
-
Ok. Please refer to
0 -
Thanks tinh,
This should help.. /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
0