I wrote the below code to capture 6 windows in all the pages [I have 2 pages now] separately.
I was using:
sess$t CaptureActiveWindow png ${namemodelwin}.png pixels 1000 1000
to capture the images and it worked. but I came across this code that would help capture image in high resolution but it uses post handle not session handle to capture images. I am not familiar with post handle. Below code is a trial I did with post handle. It didn't work. Files are all loading, but the images are not created. no errors shown.
Any advices?
proc BatchMain { } { set inputdeck [lindex $::argv 6] set resultfile [lindex $::argv 7] puts $inputdeck puts $resultfile set t [::post::GetT] hwi GetSessionHandle sess$t sess$t GetProjectHandle proj$t hwi OpenStack sess$t LoadReport Pressure_and_wear.tpl sess$t ApplyReport Pressure_and_wear replace true false 2 $inputdeck $resultfile set numpages [proj$t GetNumberOfPages]; for {set i 1} {$i <= $numpages} {incr i} { proj$t SetActivePage $i proj$t GetPageHandle pg$i $i set numwindows [pg$i GetNumberOfWindows]; for {set j 1} {$j <= $numwindows} {incr j} { pg$i GetWindowHandle wn$j $j; wn$j GetViewControlHandle vc; vc Fit; #vc Zoom 0.95; vc ReleaseHandle; pg$i SetActiveWindow wn$j set x [clock clicks] ::post::GetPostHandle p$x; set namemodelwin [puts "image_${i}_${j}"] puts $namemodelwin #sess$t CaptureActiveWindow png ${namemodelwin}.png pixels 1000 1000 p$x Draw p$x CaptureImage $namemodelwin png 4 p$x ReleaseHandle wn$j Draw wn$j ReleaseHandle } pg$i Draw pg$i ReleaseHandle #sess$t CaptureScreen png image_$i.png } hwi CloseStack proj$t ReleaseHandle sess$t Close } BatchMain