News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GdipFillRectangleI problem.

Started by Airam, July 22, 2009, 09:07:03 PM

Previous topic - Next topic

Airam

Hello!

I'm trying to paint a rectangle with border. This is a very little piece of code
<code>
Invoke GdipCreatePen1, ARGB(50, 10, 10, 10), FP4(1.0), UNITPIXEL, Addr pen

Invoke GdipDrawRectangleI, graphics, Pen, Ecx, Edx, Eax, Ebx
Invoke GdipFillRectangleI, graphics, brush, Ecx, Edx, Eax, Ebx
</code>
The problem is that I don't know how to initialize the brush. May I use GdipCreateLineBrushI ???
Other problem is that i don't know how to use GdipCreateLineBrusI. I have look for that function but i finally don't know how to use it.

Thanks in advance!!

Airam

Quote from: Airam on July 22, 2009, 09:07:03 PM
Hello!

I'm trying to paint a rectangle with border. This is a very little piece of code

QuoteInvoke GdipCreatePen1, ARGB(50, 10, 10, 10), FP4(1.0), UNITPIXEL, Addr pen

Invoke GdipDrawRectangleI, graphics, Pen, Ecx, Edx, Eax, Ebx
Invoke GdipFillRectangleI, graphics, brush, Ecx, Edx, Eax, Ebx

The problem is that I don't know how to initialize the brush. May I use GdipCreateLineBrushI ???
Other problem is that i don't know how to use GdipCreateLineBrusI. I have look for that function but i finally don't know how to use it.

Thanks in advance!!

MichaelW

Patience is a virtue.

There are some related PowerBASIC examples here, and you can use the forum search feature to find others.
eschew obfuscation

six_L

hi,Airam
try it.
OnDraw proc hDC
local @pGraphics
local @Pen,@Brush

invoke GdipCreateFromHDC,hDC,addr @pGraphics

invoke GdipCreatePen1,0FFFF0000h,defPenWidth,0,addr @Pen
invoke GdipCreateHatchBrush,HatchStyleCross,0FF00FF00h,0FF0000FFh,addr @Brush

invoke GdipDrawRectangleI,@pGraphics,@Pen,50,50,100,60
invoke GdipFillRectangleI,@pGraphics,@Brush,50,50,100,60

invoke GdipSetPageUnit,@pGraphics,UnitMillimeter
invoke GdipSetPageScale,@pGraphics,defScale
invoke GdipTranslateWorldTransform,@pGraphics,defCoorX,defCoorY,0

invoke GdipDrawRectangleI,@pGraphics,@Pen,50,50,100,60
invoke GdipFillRectangleI,@pGraphics,@Brush,50,50,100,60

invoke GdipDeleteBrush,@Brush
invoke GdipDeletePen,@Pen

invoke GdipDeleteGraphics,@pGraphics
ret

OnDraw endp
regards

Airam

Thank you very much! It works great!!

Airam