Page 1 of 1

How do I save virtual window images

Posted: Sun Jul 12, 2020 1:07 am
by huiyi_ch
Hello, guys
I need to save the image in the virtual window, but I don't know how to do it. Please help me solve it.
Thanks

Re: How do I save virtual window images

Posted: Sun Jul 12, 2020 2:06 am
by AUGE_OHR
hi,
huiyi_ch wrote: Sun Jul 12, 2020 1:07 am I need to save the image in the virtual window, but I don't know how to do it.
this Code save Context of Window except Statusbar

Code: Select all

METHOD SaveBitmap() CLASS DemoForm
LOCAL nWidth  := GetProperty( "MainForm", "ClientAreaWidth" )
LOCAL nHeight := GetProperty( "MainForm", "ClientAreaHeight" )
LOCAL nSB, aRect := { 0, 0, 0, 0 }
LOCAL cFile
   // get height of Statusbar
   nSB := GetControlHandle( "STATUSBAR", "MainForm" )
   IF !EMPTY( nSB )
      GetWindowRect( nSB, @aRect )
   ENDIF
   nHeight -= ( aRect[ 4 ] - aRect[ 2 ] )   // reduce height of STATUSBAR
   // get Name to save Bitmap
   cFile := GetInPut( "Bitmap", "save Bitmap", "DLT.BMP", 1 )
   IF EMPTY( cFile )
   ELSE
      IF FILE( cFile )
         FERASE( cFile )
      ENDIF
      // make snapshot
      Domethod( "MainForm", "Capture", cFile, 0, 0, nWidth, nHeight )
   ENDIF
RETURN NIL
you can pass "Mainform" as Parameter and use Macro cForm (no " ")

Re: How do I save virtual window images

Posted: Sun Jul 12, 2020 1:29 pm
by srvet_claudio
Hi,
See doc and Bos Taurus demo:

hBitmap := BT_BitmapCaptureClientArea (Win, Row, Col, Width, Height)

BT_BitmapSaveFile (hBitmap, cFileName, nTypePicture)

Re: How do I save virtual window images

Posted: Sun Jul 12, 2020 2:07 pm
by huiyi_ch
Thank you srvet_claudio ,
Thank you AUGE_OHR .

Re: How do I save virtual window images

Posted: Fri Jul 24, 2020 3:35 am
by huiyi_ch
Hi,
I want to save the full image in the virtual window, including the invisible part beyond the screen size.
In tests, these functions save only the visible part of the window, and the invisible part beyond the screen size is still not saved.

Re: How do I save virtual window images

Posted: Fri Jul 24, 2020 3:42 am
by AUGE_OHR
huiyi_ch wrote: Fri Jul 24, 2020 3:35 am Hi,
I want to save the full image in the virtual window, including the invisible part beyond the screen size.
In tests, these functions save only the visible part of the window, and the invisible part beyond the screen size is still not saved.
change

Code: Select all

LOCAL nWidth  := GetProperty( "MainForm", "ClientAreaWidth" )
LOCAL nHeight := GetProperty( "MainForm", "ClientAreaHeight" )
to

Code: Select all

LOCAL nWidth  := GetProperty( "MainForm", "Width" )
LOCAL nHeight := GetProperty( "MainForm", "Height" )

Re: How do I save virtual window images

Posted: Fri Jul 24, 2020 10:12 am
by srvet_claudio
Hi,
it is not possible, in a virtual window the SO only paints the visible part of the controls. The invisible part is only painted when the user scrolls the scroll bar.

Re: How do I save virtual window images

Posted: Sat Jul 25, 2020 1:08 am
by huiyi_ch
Thank you srvet_claudio.