Possible to add < roundrect > to FW_CreateBitmap ?

Possible to add < roundrect > to FW_CreateBitmap ?

Postby ukoenig » Fri Mar 23, 2018 8:48 am

Could it be possible to add < Roundrect > to the shape defines of
hBmp := FW_CreateBitmap( { nWidth, nHeight, aShapes } )
to complete it :?:

Image

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 } ), ;
oWnd:DrawImage( aBmp[ 4 ], { 0, 200, 400, 600 } ), ;
Drawroundrect(ownd) ) :?:

FUNCTION DRAWROUNDRECT(ownd)
local hdc:= oWnd:GETDC()
local oGraphics := Graphics():New( oWnd:hDC )
local oPen2 := Pen():New( 255, 255, 0, 0 , 10 )
local oPath:= Path():new()

oPath:AddRoundRect( 300, 250, 150, 100 , 20 )
oGraphics:DrawPath( oPen2, oPath )
oGraphics:destroy()
oWnd:releasedc()

Return nil

// --------------

- New Function: FW_CreateBitmap( { nWidth, nHeight, aShapes }. [lGDIP] )
--> hBitmap (if lGDIP is .F. ) or GDI+ Image Ptr if lGDIP is true
- aShapes array: This array is a collection of one or more aShape arrays.
- aShape: This array specifies one drawing component in the following format:

{ cShape, // Line, Curve, etc. Character String. First letter is only significant.
nColor, // RGB or ARGB color to be used for Pen or Brush
nPenSize, // Size of pen where pen is used. 0 indicates brush for solid shape
nRefWidth, nRefHeight, // All measurements in subsequent elements are with
// with reference to these dimensions.
// At the time of final rendering the measurements
// are proportionately scaled to the destination
// dimentions.
nRow1, nCol1, ... nRowN, nColN, [lSpec] }

nRow1, nCol1, etc indicate diffeent points used for the drawing. These
measurements are relative to the nRefWidth and nRefHeight.

- Implemented Shapes:

Line(s) { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN }
Poligon { 'L', nClr, nPenSize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, lClose }
Specify nPenSize = 0 for Filled Polygon
Rectangle { 'R', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Ellipse { 'E', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight }
Curve { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRowN, nColN, nTension }
Bezier { 'C', nClr, nPensize, nRefWidth, nRefHeight, nRow1, nCol1, .... nRow4, nCol4 }
Arc { 'A', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }
Pie { 'P', nClr, nPenSize, nRefWidth, nRefHeight, nTop, nLeft, nBottom, nRight, nAngle, nSweep }

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wmormar and 68 guests