FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DrawBitmap
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
DrawBitmap
Posted: Mon Jan 06, 2020 12:09 PM

on oldest class I have DrawBitmap
But it show only Bitmap files
I load the files with new ReadImage() so I have also the size
I wish use also png files how I can converte it ?
I must use bitblt ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DrawBitmap
Posted: Mon Jan 06, 2020 02:58 PM
Code (fw): Select all Collapse
aBmp := FW_ReadImage( ..... )
DrawBitmap( hDC, aBmp[ 1 ], nRow, nCol )
PalBmpFree( aBmp )
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: DrawBitmap
Posted: Mon Jan 06, 2020 06:16 PM
Nages,
on ::acBitmaps I Insert an array with many png files

for n = 1 to len( ::acBitmaps )
aadd( ::aBitmaps, FW_ReadImage( ::acBitmaps[ n ] ) )
next n

then

xbrowser ::aBitmaps

give me this


if I use aadd( ::aBitmaps, ::ReadImage(::acBitmaps[ n ] ) )

then give me the right list


on method paint I have

DrawBitmap( ::hDC, ::aBitmaps[ max( ::nActual , 1 ) ], nRow, nCol, ::nWBmp, ::nHBmp, SRCCOPY )

because before the class run with only bmp file

how I can to converte it to run with png files ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: DrawBitmap
Posted: Tue Jan 07, 2020 01:25 AM
This is wrong
Code (fw): Select all Collapse
FW_ReadImage( ::acBitmaps[ n ] )


Correct
Code (fw): Select all Collapse
FW_ReadImage( NIL, ::acBitmaps[ n ] )


FW_ReadImage reads all image files including png, jpg, etc.

You can use DrawBitmap() if you have a personal preference, but FW_DrawImage( hDC/oWnd, uImage, aRect, ... ) is more advanced than all other image drawing functions.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: DrawBitmap
Posted: Thu Jan 09, 2020 09:44 AM

I'll try it
I'm converting a oldest class use only bmp files and I need also png files

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion