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.
how to do this in the rest of the code?
#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
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 use
[code]
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.
@ 125, 10 TITLEIMG OF oTitle4 BITMAP FW_ReadImage( nil, "PNGRESOURCE" )[ 1 ] SIZE 30, 30
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"
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" )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: George, nageswaragunupudi and 28 guests