Page 1 of 1

load png from rpreview

Posted: Wed Nov 15, 2023 1:16 pm
by Silvio.Falconi
I need to coverte this function to use on rpreview to load my png images

oBtn:hBitmap1 = FWBitmap2( "EXCEL" )

it run but the image is compress so is not compatible with png

STATIC FUNCTION FWBitmap2( cResname )
LOCAL oBitmap
DEFINE BITMAP oBitmap RESNAME cResname
IF HB_IsObject( oBitmap )
RETURN oBitmap:hBitmap
ENDIF
RETURN 0

Re: load png from rpreview

Posted: Wed Nov 15, 2023 3:34 pm
by nageswaragunupudi
to use on rpreview to load my png images
Do you want to use png images on the buttonbar for rpreview?

Re: load png from rpreview

Posted: Wed Nov 15, 2023 3:56 pm
by nageswaragunupudi
To use png images on any buttonbar

Code: Select all | Expand

   DEFINE BUTTONBAR oBar OF oWnd SIZE 64,64 2010
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image7.png(32x32)" PROMPT "Onr"
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image8.png(32x32)" PROMPT "Two"
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image9.png(32x32)" PROMPT "Three"
 
Image

Re: load png from rpreview

Posted: Wed Nov 15, 2023 9:00 pm
by Silvio.Falconi
nageswaragunupudi wrote:To use png images on any buttonbar

Code: Select all | Expand

   DEFINE BUTTONBAR oBar OF oWnd SIZE 64,64 2010
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image7.png(32x32)" PROMPT "Onr"
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image8.png(32x32)" PROMPT "Two"
   DEFINE BUTTON OF oBar FILE "..\bitmaps\pngs\image9.png(32x32)" PROMPT "Three"
 
Image
Yes of course but Then i have problems with zoom buttons because have two pngs
Hbitmap1 and hbitmap2

Re: load png from rpreview

Posted: Thu Nov 16, 2023 7:47 am
by Silvio.Falconi
oPreview:oZoom:hBitmap1 = FWBitmap( "Zoom2" )
oPreview:oZoom:hBitmap2 = FWBitmap( "OnePage2" )
oPreview:oZoom:bBmpNo = { || If( oPreview:lZoom, 2, 1 ) }


How I can converte it ? How I can change the images with mine pngs ?

Re: load png from rpreview

Posted: Thu Nov 16, 2023 9:56 am
by nageswaragunupudi

Code: Select all | Expand

oPreview:oZoom:hBitmap1 = FW_ReadImage( nil, "aa.png(32x32)" )[ 1 ]
oPreview:oZoom:hBitmap2 = FW_ReadImage( nil, "bb.png(32x32)" )[ 1 ]
oPreview:oZoom:bBmpNo = { || If( oPreview:lZoom, 2, 1 ) }

Re: load png from rpreview

Posted: Thu Nov 16, 2023 12:47 pm
by Silvio.Falconi
Now Run ok