Drawing PNG files with transparencies

Drawing PNG files with transparencies

Postby toninhofwi » Mon Apr 06, 2009 6:43 pm

Hi,

This is the way to draw PNG images using FWH and freeimage:

hBmp = PngToBitmap( hDC, "c:\myfile.png" )
ABPaint( hDC, 10, 10, hBmp )


---cut---
HB_FUNC( PNGTOBITMAP )
{
HDC hDC = ( HDC ) hb_parnl( 1 );

FIBITMAP *dib;

FREE_IMAGE_FORMAT fiSource;

fiSource = FreeImage_GetFileType( ( LPSTR ) hb_parcx( 2 ), 0 );

dib = FreeImage_Load( fiSource, ( LPSTR ) hb_parcx( 2 ), 0 );

hb_retnl( ( LONG ) CreateDIBitmap( hDC, FreeImage_GetInfoHeader( dib ), CBM_INIT, FreeImage_GetBits( dib ), FreeImage_GetInfo( dib ), DIB_RGB_COLORS ) );
}
---cut---


Regards,

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Drawing PNG files with transparencies

Postby Antonio Linares » Mon Apr 06, 2009 7:06 pm

Toninho,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests