Re: [gtkmm] problem using stipple in Gdk::GC



On Mon, 2002-11-11 at 23:02, Eric Newman wrote:
> I'm trying to use a stipple pattern in a GC and it's giving me X Window System Error. Here's a code snippet:
> 
> Glib::RefPtr<Gdk::Pixmap> m_stipple =
> Gdk::Pixmap::create_from_xpm (get_window(), m_trans_color, "stipple.xpm");
> myGC->set_stipple(m_stipple);
> m_refPixmap->draw_rectangle ( myGC,
>                               true,
>                               0, 0,
>                               10, 10);
> 
[snip]
> The error was 'BadMatch (invalid parameter attributes)'.
[snip]

> Thanks,
> Eric

You will need a Bitmap, not a Pixmap. I would suggest creating a
Gdk::PixBuf and using the render_threshold_alpha menthod to fill the
Bitmap.

HTH,
Tassos

-- 
Tassos Bassoukos

Never be afraid to try something new. - Remember that amateurs built
the ark. Professionals built the Titanic. --  unknown 

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]