Hi to all!
It there a way to get the bitmap sizes (width & height) read by ReadBitmap() function ?
TIA & Regards, Euclides
// using FWH-function : Gradient( hDC, aRect, nVColor, nBColor, .T. )
// -----------------------------------------------------------------------
// nVcolor = 1. Gradient-color
// nBColor = 2. Gradient-color
// nColor = Text-color
// cText = String
// e_oBfont2 = Font
// B_Posleft = Left Start-pos. of text
// B_Orient = Hor. / Vert.
// B_Brush = Brush used if no gradient needed
// B_pen = Box-frame
// B_End = Row-position of browser-selection
FUNCTION ONPAINTT( hDC,oBmp, nVcolor, nBColor, nColor, cText, ;
e_oBfont2, B_POSLEFT, B_END,B_ORIENT, B_BRUSH, B_PEN )
LOCAL hOldFont, oNewbrush
hOldFont := SelectObject( hDC, e_oBFont2:hFont )
nTXTLG := GettextWidth( hDC, cText )
// Your values !!!!
// ------------------
nBMPWIDTH := oBmp:Super:nWidth()
nBMPHIGHT := oBmp:Super:nHeight()
nFONTHIGHT := e_oBfont2:nInpHeight * -1
nLEFT := 0
IF B_POSLEFT = 0
nLEFT := nBMPHIGHT - ((nBMPHIGHT - nTXTLG) / 2)
ELSE
nLEFT := nBMPHIGHT - nLeft
ENDIF
nNEWHIGHT := nFONTHIGHT
nTOP := (nBMPWIDTH - nNEWHIGHT) / 2
// Browser selection ( brushes if not using colors )
// ---------------------------------------------------------
IF B_END = 8
DEFINE BRUSH oNewBrush STYLE BORLAND
ENDIF
IF B_END = 9
DEFINE BRUSH oNewBrush STYLE TILED
ENDIF
IF B_END = 10
DEFINE BRUSH oNewBrush STYLE BRICKS
ENDIF
IF B_END = 12
DEFINE BRUSH oNewBrush FILE B_BRUSH
ENDIF
aRect := GETCLIENTRECT( oBmp:hWnd )
IF B_END <> 8 .and. B_END <> 9 .and. B_END <> 10 ;
.and. B_END <> 12
// Horizontal
nGRADIENT := Gradient( hDC, aRect, nVColor, nBColor, .T. )
IF B_ORIENT = 2
// Vertical
nGRADIENT := Gradient( hDC, aRect, nVColor, BColor, .F. )
ENDIF
oBmp:oBrush := TBrush():New( , nGRADIENT )
ELSE
oBmp:oBrush := oNewbrush
ENDIF
FillRect( hDC, aRect, oBmp:oBrush:hBrush )
SetBkMode( hDC, 0 ) // 1 = Transparent
SetTextColor( hDC,nColor)
TextOut( hDC, nLEFT, nTOP, cText )
SelectObject( hDC, hOldFont )
IF B_PEN > 0
DRAWBOX( aRect, hDC, nColor, nBMPWIDTH, nBMPHIGHT, B_PEN )
ENDIF
RETURN NIL
Euclides wrote:Hi to all!
It there a way to get the bitmap sizes (width & height) read by ReadBitmap() function ?
TIA & Regards, Euclides
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 90 guests