Re: Re: drawing a generated bitmap



> Well, I can't speak Nemerle, but as far as I understand it,
> you first fill the image with arbitrary values no one knows
> which color they correspond to in the colormap, then
> allocate one very dark red color (full red is 0xffff in
> Gdk) but never use it -- the `pixel' field filled by
> AllocColor is the value to use with PutPixel -- and after
> all that you set the image's colormap.

> To draw you have to allocate the colors *first* -- and note
> if the display is not direct/true-color, it has a limited
> number of colors and you will not be able to allocate a new
> color for each unique (x+y):>UInt32 value.

so that's the way it works! oh dear, thank you very much! you've saved me 
headache for at least a week :)
the thing is that i got completely lost about the concept of colour allocation 
and colour.pixel value. i've utterly failed to understand the meaning of 
"hardware pixel" as it is put in the docs.
actually, this also why i sticked to image instead of pixbuf - i thought 
image.putpixel's colour parameter was the traditional way, and was afraid to 
use pixbuf.drawpoint's gc.foreground because i couldn't understand it.
but now the penny dropped, thank you a great lot :) i definitely owe you a 
beer or two in case we ever met :)

ps. i'm very sorry about the mess with my posts... this is the first time i'm 
using a mailing list...



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