Save2Bmp

Post Reply
User avatar
Pier Luigi
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Save2Bmp

Post by Pier Luigi »

I would want to save a bitmap with this function:

Code: Select all

Function Save2Bmp( cFile )

   LOCAL hBmp, hDib

   DEFAULT cFile := CurDir() + "\Graph.Bmp"

   hBmp := WndBitmap( oWnd:hWnd )
   hDib := DibFromBitmap( hBmp )

   DibWrite( cFile, hDib )
   GloBalFree( hDib )
   DeleteObject( hBmp )

RETURN ( nil )

but I obtain this error:

myprg.obj : error LNK2001: unresolved external symbol "void __cdecl HB_FUN_GLOBALFREE(void)" (?HB_FUN_GLOBALFREE@@YAXXZ)
myprg.obj : error LNK2001: unresolved external symbol "void __cdecl HB_FUN_WNDBITMAP(void)" (?HB_FUN_WNDBITMAP@@YAXXZ)

GlobalFree and WndBitmap functions are included in FWPPC?

Regards,
Pier Luigi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Pier,

The problem is that Windows Mobile does not implement GetDIBits() which it is used from DibFromBitmap().

We are trying to implement a replacement for it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Pier Luigi
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Post by Pier Luigi »

Many thanks.

Regards,
Pier Luigi
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Pier Luigi,

We have already implemented support to save any window or control as a BMP file.

Code: Select all

#include "FWCE.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      
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Pier Luigi
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Post by Pier Luigi »

Great!

Many thanks.

Regards.
Pier luigi
Post Reply