Use PNG image (Solved)
Use PNG image (Solved)
Hello guys...
At BTNBMP I can use PNG images just by adding data to the resource file and calling this resource in the code, how to do this in the rest of the code?
Thanks.
At BTNBMP I can use PNG images just by adding data to the resource file and calling this resource in the code, how to do this in the rest of the code?
Thanks.
Last edited by ctoas on Tue Feb 02, 2021 3:27 am, edited 1 time in total.
Christiano Augusto Silveira
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
Re: Use PNG image
Christiano,
can You please explain what You mean with
regards
Uwe
can You please explain what You mean with
maybe showing a dialog-image ( or other control-image ) from resourcehow to do this in the rest of the code?
regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Use PNG image
If you want to use it in any image control or other control like TBitmap, TImage, XBrowse, etc you can use the resource name in the place where you use an image or bmp file name.
If you want to just display the image on any window, dialog, control, you can use
If you want to just display the image on any window, dialog, control, you can use
Code: Select all
oWnd:DrawImage( cResource, { nTop, nLeft, Bottom, nRight } )
// OR
FW_DrawImage( hDC, cResource, { nTop, nLeft, Bottom, nRight } )
[/code[
In other words, you can use the resource name wherever you use any other resource or image/bmp file.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Use PNG image
Hello ukoenig ....
I discovered this by accident, the tBTNBMP class can read a PNG image inserted in the resource file as DATA.
Download the resource file with PNG's
http://maxxtech.com.br/forum/PNG.RES
I discovered this by accident, the tBTNBMP class can read a PNG image inserted in the resource file as DATA.
Code: Select all
#INCLUDE "FIVEWIN.CH"
FUNCTION TESTE()
PRIVATE oWnd, oBar
DEFINE WINDOW oWND FROM 0,0 TO 16,60 TITLE "TESTE" NOZOOM NOICONIZE BORDER NONE
DEFINE BUTTONBAR oBar 3DLOOK OF oWnd SIZE 0080,0080 2007 NOBORDER
#IFNDEF GRAD_BTNS_ONLY
oBar:bClrGrad := {|lMouseOver|If(!lMouseOver,{{1,nRGB(205,165,090),nRGB(205,165,090)}},;
{{1,nRGB(205,165,090),nRGB(205,165,090)}})}
#ENDIF
@ 0010,0003 BTNBMP oBtnAGENDA BITMAP "BAR_AGENDA1" ,"BAR_AGENDA2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
@ 0010,0083 BTNBMP oBtnCLIENTE BITMAP "BAR_CLIENTES1","BAR_CLIENTES2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
@ 0010,0163 BTNBMP oBtnFERRAMENTAS BITMAP "BAR_TOOLS1" ,"BAR_TOOLS2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
@ 0010,0243 BTNBMP oBtnCONFIGURACAO BITMAP "BAR_CONFIG1" ,"BAR_CONFIG2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
@ 0010,0323 BTNBMP oBtnAJUDA BITMAP "BAR_AJUDA1" ,"BAR_AJUDA2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
@ 0010,0413 BTNBMP oBtnENCERRAR BITMAP "BAR_ONOFF1" ,"BAR_ONOFF2" SIZE 0060,0060 PIXEL OF oBar FLAT NOBORDER
#IFDEF GRAD_BTNS_ONLY
oBtn:bClrGrad := {|lMouseOver|If(!lMouseOver,{{1,nRGB(205,165,090),nRGB(205,165,090)}},;
{{1,nRGB(205,165,090),nRGB(205,165,090) }})}
oBtn:mode := "RIGHT"
#ENDIF
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
http://maxxtech.com.br/forum/PNG.RES
Christiano Augusto Silveira
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
Re: Use PNG image
nageswaragunupudi wrote:If you want to use it in any image control or other control like TBitmap, TImage, XBrowse, etc you can use the resource name in the place where you use an image or bmp file name.
If you want to just display the image on any window, dialog, control, you can useCode: Select all
oWnd:DrawImage( cResource, { nTop, nLeft, Bottom, nRight } ) // OR FW_DrawImage( hDC, cResource, { nTop, nLeft, Bottom, nRight } ) [/code[ In other words, you can use the resource name wherever you use any other resource or image/bmp file.[/quote] Thank you Nages .... I'll try.
Christiano Augusto Silveira
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
Re: Use PNG image
Hello Nages.
I managed to put the image in the empty dialog without problems, but I would like to put the image on the tTITLE class and I'm not getting it. Could you give me this help?
I managed to put the image in the empty dialog without problems, but I would like to put the image on the tTITLE class and I'm not getting it. Could you give me this help?
Christiano Augusto Silveira
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
christiano.silveira@gmail.com
MaxxTech Soluções em TI
http://www.maxxtech.com.br
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Use PNG image
TTitle class does not natively support any image format other than BMP.
Now that you raised this topic, we will provide this facility in the coming versions.
For now, I suggest you adopt this work-around and this works well:
Use
FW_ReadImage( nil, <YOURRESOURCE> )[ 1 ]
in the place of image-name in the command or method.
Eg:
Now that you raised this topic, we will provide this facility in the coming versions.
For now, I suggest you adopt this work-around and this works well:
Use
FW_ReadImage( nil, <YOURRESOURCE> )[ 1 ]
in the place of image-name in the command or method.
Eg:
Code: Select all
@ 125, 10 TITLEIMG OF oTitle4 BITMAP FW_ReadImage( nil, "PNGRESOURCE" )[ 1 ] SIZE 30, 30
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Use PNG image
The above workaround is tested and working well.
From the next version FWH2101, we can directly use any image source, bmp,jpg,png.ico,cur, etc either filename, resource, image buffer or web-ref.
From the next version FWH2101, we can directly use any image source, bmp,jpg,png.ico,cur, etc either filename, resource, image buffer or web-ref.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Use PNG image
on my code I have, on RC file:
then use it simply with:
Code: Select all
PNG_REPEDI_SORT1_16 10 "..\\Images\\Common\\16x16\\ordina_A.png"
PNG_REPEDI_SORT2_16 10 "..\\Images\\Common\\16x16\\ordina_D.png"
PNG_REPEDI_SUM_16 10 "..\\Images\\Common\\16x16\\somma.png"
Code: Select all
aPngSort := {nil,nil}
aPngSort[1] := oWnd:ReadImage( "PNG_REPEDI_SORT1_16" )
aPngSort[2] := oWnd:ReadImage( "PNG_REPEDI_SORT2_16" )
oPngSomma := oWnd:ReadImage( "PNG_REPEDI_SUM_16" )