in reply to Tk::Canvas and using stipples

IIRC there are examples of canvas stipples in the "widget" demo bundled with Tk.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

Replies are listed 'Best First'.
Re^2: Tk::Canvas and using stipples
by BrowserUk (Patriarch) on Feb 03, 2006 at 10:56 UTC

    I've found examples, and made my own, of using stippled lines and outlines, but the knowledge does not seem to transfer to doing stippled fills.

    Since posting, I turned up this quote from the 300 and something google hit on my fourth set of search criteria:

    ====================================================================== +== #12.4. How can I get bitmaps created with 'image' to work with '-stipple'? At the moment, you can't. Bitmaps created with 'image create bitmap ...' do not use 'Tk_DefineBitmap', which is required for '-stipple' to know it's a bitmap. Instead, you'll have to use the old format for using bitmaps in stipples, like so: .canvas create rect 10 10 80 80 -fill black -stipple @/path/to/my.bmp It's not a simple C fix for the above problem, but it's on Sun's ToDo list.

    Whether that is relevant, still current, whatever, I have no idea.

    I also previously went through my copy of Perl/Tk (on CD) looking for a worked example, but there either isn't one in there or I managed to miss it?

    I've tried using both the built-in stipples (gray50, gray25) etc. and bitmaps I've created myself using DefineBitmap(). Once I got the incatations right, I ceased getting errors, but it simply has no effect on the graphic? Hence, asking if there was an example out there. Three solid hours of Googling hasn't turned up a single piece of code that does a stippled fill.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.