I need help with GdipFillRectangle and the HatchStyleCross style.

Started by Airam, July 25, 2009, 11:29:59 AM

Previous topic - Next topic

Airam

Hi!!
I'm trying to get this code work:

invoke GdipCreateHatchBrush, HatchStyleCross, pColorBlack, pColorWhite, pBrush4
invoke GdipFillRectangle,pGraphics, pBrush4, 120, 100, 100, 50

which has been extracted from here:

http://www.jose.it-berater.org/smfforum/index.php?topic=263.0

The problem is that i get an error by using HatchStyleCross. Then i changed that identifier and i put 4 (i searched it on Internet and find that HatchStyleCross=4), but it still doesn't work.
Does anyone knows what I'm doing wrong?

jj2007

invoke GdipCreateHatchBrush, HatchStyleCross, pColorBlack, pColorWhite, pBrush4
invoke GdipFillRectangle,pGraphics, pBrush4, 120, 100, 100, 50

It seems you are using pBrush4, but you don't create it. Since I don't have the API specification, I can only guess that
  invoke GdipCreateHatchBrush, HatchStyleCross, pColorBlack, pColorWhite, addr pBrush4
  invoke GdipFillRectangle,pGraphics, pBrush4, 120, 100, 100, 50
could work. If not, try
  invoke GdipCreateHatchBrush, HatchStyleCross, pColorBlack, pColorWhite, addr pBrush4
  invoke GdipFillRectangle,pGraphics, addr pBrush4, 120, 100, 100, 50

Airam

thank you jj2007 for your help, but it still doesn't work. These are the 2 problematic lines:

   Invoke GdipCreateHatchBrush, 4, ARGB(255, 0, 0, 0), ARGB(255, 0, 0, 0), Addr brush1
   Invoke GdipFillRectangle, graphics, brush1, 0, 0, 500, 500

I think the problem could be the first parameter of GdipCreateHatchBrush.

Any other ideas?

sonic

well looking at just these two lines it's difficult to say anything imo. You could post the entire error description or better the source to let anybody have a look at the problem.