Re: Converting pixmaps to bitmaps.



"Ian King" <king eiffel com> writes:
> I am well aware of this fact, but this doesn't answer my question :)  I am
> writing the linux implementation of EiffelVision 2 and our preferred
> functionality is to have multifunction pixmaps (EV_PIXMAP's) that the user
> can use anywhere applicable.  If a user creates an EV_PIXMAP, from say, a
> PNG file, they may then manipulate this EV_PIXMAP and even use it as a
> cursor.  If I had a 24bit pixmap, how can I convert it to a 1 bit pixmap
> which may then be set as a cursor?
> 

Right. This is much easier if you use GdkPixbuf for your generic image
type, then you can convert between formats without having to suck
image data from the server and push it back again.

So to do this you a) decide what it means; do you make all magenta
pixels into enabled bits in the bitmap? or dark pixels become enabled
bits in the bitmap, light pixels disabled? b) suck the image data off
the server with gdk_image_get() (or gdk_pixbuf_get_from_drawable())
c) apply the algorithm you picked in a), writing the result into a
newly-created bitmap.

Havoc




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