re: drawing a generated bitmap



hello :)

sorry for writing to you at your private address instead of the gtk list but 
it seems that using a mailing list exceeds my computer skills :/
anyway, i'd like to thank you very much for your answer. it made me finally 
understand how stuff works.

here's the answer i think i failed to post on the list:

>> 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 :)

thanks again,
kamil stachowski



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