ukoenig wrote:Rao,
the left upper corner is different in color
to show a black frame
regards
Uwe
On the subject of bitmaps like this, I can suggest a small function which can create such bitmaps on the fly.
We can specify the inner color, border color and thickness. We can even specify translucent alpha colors.
We can specify width, height and shape, rectangle, square, circle, ellipse.
The bitmap produced is an alpha bitmap.
- Code: Select all Expand view
- function ColorBlockBmp( nColor, nBorderColor, nWidth, nHeight, nBorderSize, lEllipse )
local hBmp, x, cShape, aShapes := {}
DEFAULT nColor := CLR_WHITE, nBorderColor := CLR_BLACK, nWidth := 64, nHeight := 16, ;
nBorderSize := 2, lEllipse := .f.
x := Ceiling( nBorderSize / 2 )
cShape := If( lEllipse, "E", "R" )
AAdd( aShapes, { cShape, nColor, 0, nWidth, nHeight, 0, 0, nHeight - 1, nWidth - 1 } )
if nBorderSize > 0
AAdd( aShapes, { cShape, nBorderColor, nBorderSize, nWidth, nHeight, x, x, ;
nHeight - x - 1, nWidth - x - 1 } )
endif
hBmp := FW_CreateBitmap( { nWidth, nHeight, aShapes } )
return hBmp
This is a test program using the above function.
- Code: Select all Expand view
- #include "fivewin.ch"
function Main()
local aBmp[ 3 ]
local oWnd, oBrush
aBmp[ 1 ] := ColorBlockBmp( CLR_HGREEN, CLR_BLACK,128, 48, 4 )
aBmp[ 2 ] := ColorBlockBmp( nARGB( 128, CLR_WHITE ), CLR_HBLUE, 128,128, 6, .T. )
aBmp[ 3 ] := ColorBlockBmp( CLR_YELLOW, CLR_HRED, 128, 128, 6 )
DEFINE BRUSH oBrush FILE "\fwh\bitmaps\sea.bmp" RESIZE
DEFINE WINDOW oWnd BRUSH oBrush
ACTIVATE WINDOW oWnd ON PAINT ( ;
oWnd:DrawImage( aBmp[ 1 ], { 0, 0, 200, 150 } ), ;
oWnd:DrawImage( aBmp[ 2 ], { 0, 150, 200, 300 } ), ;
oWnd:DrawImage( aBmp[ 3 ], { 0, 300, 200, 600 } ) )
AEval( aBmp, { |o| DeleteObject( o ) } )
RELEASE BRUSH oBrush
return nil