buenas estimados
tengo la siguiente duda
digamos que tengo una barra con botones clase tbar
se puede hacer que en dicha barra tenga un brush de fondo que se ajuste al tamaño de la barra un bmp o jpg o png
// \SAMPLES\BARBRUSH.PRG
#include "Fivewin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oBar, oBtn1, oBrush
DEFINE BRUSH oBrush COLOR CLR_HBLUE
DEFINE WINDOW oWnd TITLE "Testebar" FROM 118, 266 TO 561, 801 PIXEL ;
COLOR 0, 14215660
DEFINE BUTTONBAR oBar OF oWnd _3D Size 030, 030
DEFINE BUTTON oBtn1 OF oBar
oBar:SetBrush( oBrush )
ACTIVATE WINDOW oWnd
RETURN NIL
// \SAMPLES\BARBRUSH.PRG
#include "Fivewin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oBar, oBtn1, oBrush
// DEFINE BRUSH oBrush COLOR CLR_HBLUE
// Desde Recursos:
// DEFINE BRUSH oBrush RESOURCE "WPaper" STRETCH // O RESIZE
DEFINE BRUSH oBrush FILE "..\bitmaps\BRUSH4.bmp" STRETCH // O RESIZE
DEFINE WINDOW oWnd TITLE "Testebar" FROM 118, 266 TO 561, 801 PIXEL ;
COLOR 0, 14215660
DEFINE BUTTONBAR oBar OF oWnd _3D Size 030, 030
DEFINE BUTTON oBtn1 OF oBar
oBar:SetBrush( oBrush )
ACTIVATE WINDOW oWnd
RETURN NIL
// FIN / END
// \SAMPLES\BARBRUSH.PRG
#include "Fivewin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oBar, oBtn1, oBrush, oBmp
// DEFINE BRUSH oBrush COLOR CLR_HBLUE
// Desde Recursos:
// DEFINE BRUSH oBrush RESOURCE "WPaper" STRETCH // O RESIZE
DEFINE BRUSH oBrush FILE "..\bitmaps\BRUSH4.bmp" STRETCH // O RESIZE
// DEFINE WINDOW oWnd TITLE "Testebar" FROM 118, 266 TO 561, 801 PIXEL ;
// COLOR 0, 14215660
DEFINE WINDOW oWnd MDI STYLE nOr( WS_POPUP )
oWnd:SetColor( CLR_WHITE, Rgb( 44, 44, 44 ) )
DEFINE BUTTONBAR oBar OF oWnd _3D Size 030, 030 NOBORDER
WITH OBJECT oBar
oBar:nClrText := CLR_BLACK
// oBar:Setcolor( CLR_GRAY, Rgb( 36, 36, 36 ) )
oBar:SetBrush( oBrush )
oBar:bRClicked := { || NIL }
oBar:bLClicked := { || NIL }
// oBar:SetFont( oFont )
oBar:Adjust()
END
DEFINE BUTTON oBtn1 OF oBar PROMPT "Exit" ACTION( oWnd:End() )
oBtn1:Setcolor( CLR_GRAY, Rgb( 36, 36, 36 ) )
DEFINE BITMAP oBmp FILENAME "..\bitmaps\BACK.bmp" // WOW()!!
oWnd:bPainted = { | hDC | BmpTiled( hDC, oWnd, oBmp ) }
ACTIVATE WINDOW oWnd MAXIMIZED
RETURN NIL
STATIC FUNCTION BmpTiled( hDC, oWnd, oBmp )
local nWidth := oWnd:nWidth(), nHeight := oWnd:nHeight()
local nRow := 0, nCol := 0, n
local nBmpWidth := oBmp:nWidth(), nBmpHeight := oBmp:nHeight()
if oBmp:hBitmap == 0
return nil
endif
while nRow < nHeight
nCol = 0
while nCol < nWidth
PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )
nCol += nBmpWidth
end
nRow += nBmpHeight
end
RETURN NIL
// FIN / END
claudio.leiva wrote:karinha
el brush se repite y repite,,, como se puede ajustar al ancho de la barra
como pongo una imagen aca?
para que veas
@ 003, 650 BTNBMP oBtn2 OF oBar SIZE 50, 30 PIXEL FLAT ADJUST ;
GDIPLUS BITMAP "..\bitmaps\EXCEL.bmp" LEFT NOROUND WHEN( .F. )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 42 guests