DrawBitmap

DrawBitmap

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: DrawBitmap

Postby nageswaragunupudi » Mon Jan 06, 2020 2:58 pm

Code: Select all  Expand view
aBmp := FW_ReadImage( ..... )
DrawBitmap( hDC, aBmp[ 1 ], nRow, nCol )
PalBmpFree( aBmp )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: DrawBitmap

Postby Silvio.Falconi » Mon Jan 06, 2020 6: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
Image

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

then give me the right list
Image

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: DrawBitmap

Postby nageswaragunupudi » Tue Jan 07, 2020 1:25 am

This is wrong
Code: Select all  Expand view
FW_ReadImage( ::acBitmaps[ n ] )


Correct
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: DrawBitmap

Postby Silvio.Falconi » Thu Jan 09, 2020 9: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 61 guests