Well, of course as soon as I posted this...

Upon closer inspection of the docs, I figured out you _still_ have to define
a custom pattern and set that.

Even though the headers and docs initially lead you to believe that setting
it to a defined patter will work it does not.

Items added to the function to make it work are:

    CustomPatternType pattern = {0,0,0,0,0,0,0,0};      // Black

    WinSetPattern (&pattern);

(for archiving and searchability for the next person: WinSetPattern
WinSetCustomPattern WinFillRectangle )
-- 
Matt Disher
[EMAIL PROTECTED]


> From: Matt Disher (TiBook) <[EMAIL PROTECTED]>
> Date: Sun, 07 Apr 2002 12:18:51 -0400
> To: Palm Developer Forum <[EMAIL PROTECTED]>
> Subject: getting WinFillRectangle to fill ?
> 
> I'm struggling to get WinFillRectangle to actually fill :/
> 
> The results continue to be a while rectangle regardless of the pattern setting
> or the foreground color.  I have the following code in a  MainFormInit
> function that I've been twiddling with and just can't figure out why it won't
> draw or change the pattern.
> 
> static void MainFormInit(FormType * frmP)
> {
> RectangleType    rect;
> IndexedColorType    black;
> RGBColorType rgb;
> 
> 
> FrmDrawForm(frmP);
> 
> 
> MemSet(&rgb, sizeof(RGBColorType), 0);
> RctSetRectangle(&rect, 50, 50, 50, 50);
> WinSetPatternType (grayPattern);
> black = WinRGBToIndex(&rgb);
> WinSetForeColor(black);
> WinSetDrawMode(winPaint);
> WinDrawRectangleFrame(simpleFrame, &rect);
> WinFillRectangle(&rect, 0);
> }
> 
> The frame is drawn as expected yet no matter what I've tried I can't get
> anything other than a white rectangle fill.   The only thing I have not tried
> yet is defining a custom pattern as I would assume the defines (blackPattern,
> or grayPattern) would give me what I'm looking for.
> 
> any tips ?
> 
> -- 
> Matt Disher
> [EMAIL PROTECTED]


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to