Fill Shapes with DirectDraw

Unti
02-22-2002, 01:09 PM
Hello,
does anyone know, who to fill shapes with DirectDraw like the API ExtFloodFill?

Squirm
02-23-2002, 06:21 AM
If you are drawing the shapes using normal DirectDraw methods such as DrawBox and DrawCircle then you can set the fillstyle like so:

Surface.SetFillStyle 0 'Solid
Surface.SetFillStyle 1 'Default - Transparent
Surface.SetFillStyle 2 'Horizontal Line
Surface.SetFillStyle 3 'Vertical Line
Surface.SetFillStyle 4 'Upward Diagonal
Surface.SetFillStyle 5 'Downward Diagonal
Surface.SetFillStyle 6 'Cross
Surface.SetFillStyle 7 'Diagonal Cross

However, it is possible to use the API directly to surfaces in DirectDraw, which means you can use any normal API, and is much much faster than native DD Draw methods. :)

Dim surfDC As Long
surfDC = Surface.GetDC

'Do any API calls here, with surfDC passed as the hDC as required
'For example:
DrawEdge surfDC, myRect, BDR_RAISEDINNER, BF_RECT

'And when you've finished with ALL your API calls:
Surface.ReleaseDC surfDC

Unti
02-24-2002, 07:45 AM
Ok, I'll try. Thank you.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum