FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to save a dialog/window to Bitmap ?
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
How to save a dialog/window to Bitmap ?
Posted: Sun Jul 29, 2007 04:47 PM
Hello Mr.Antonio

The following function is not saving the window to bitmap.

#include "Fivewin.ch" 

function Main() 

   DEFINE WINDOW oWnd TITLE "SaveToBmp" 

   @ 9, 2 BUTTON "Save To Bmp" ; 
      SIZE 210, 30 ; 
      ACTION ( oWnd:SaveToBmp( CurDir() + "\test.bmp" ), MsgInfo( "done!" ) ) 
      
   ACTIVATE WINDOW oWnd 
    
return nil


I tried with the following code also. But could not get the result.

FUNCTION Save2Bmp( cFile, oDlg )

   DEFAULT cFile := "Saved.Bmp"

   DibWrite( cFile, DibFromBitmap( WndBitmap( oDlg:hWnd ) ) )

RETURN ( FILE( cFile ) )


Please guide me how to save a dialog/window to bitmap file.

Regards

- Ramesh Babu P
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
How to save a dialog/window to Bitmap ?
Posted: Sun Jul 29, 2007 07:24 PM
Call it this way:

... ACTION ( oWnd:SaveToBmp( "test.bmp" ), MsgInfo( "done!" ) )

Here its working fine:
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
How to save a dialog/window to Bitmap ?
Posted: Mon Jul 30, 2007 01:31 AM

Sorry! Mr.Antonio,

It is generating a small file of 14 bytes.

I tried with oWnd:SaveToBmp(cBmpFile) and
DibWrite( cBmpFile, DibFromBitmap( WndBitmap( oDlg:hWnd ) ) ).

But, same out come.

For your information, it is tested in WIN98 and found not working.

Please test with 2.8 (Septermber) release.

  • Ramesh Babu P

Continue the discussion