Document reference for working with bitmaps in Cocoa?

  • Hi all.

    I've been working with the NSBitmapImageRep class in order to create
    bitmaps from Raster/Sample data I am obtaining from an external source.

    I'm having problems getting the "alpha channel" to work correctly.

    If I exclude alpha, my bitMapData is just an array of bytes (unsigned
    char*) that contains the pixels samples in RGB format (three bytes
    per pixel.)

    But if I include an alpha byte in ARGB format, my bitmap no longer
    displays. Actually, it's all white, but when I draw it selected, with
    a blue background, my image shows up but only the Red colors show.

    So clearly, I'm not understanding how I'm supposed to format the
    bitMapData array when I want to include an alpha channel.

    I would appreciate any document references on this subject. I've read
    the API docs for NSImage, NSImageRep, and NSBitmapImageRep. I also
    have the Bunny Core Graphics book, but that's a much lower-level API
    and doesn't cover this topic.


    Rob Ross, Lead Software Engineer
    E! Networks
    "Beware of he who would deny you access to information, for in his
    heart he dreams himself your master." -- Commissioner Pravin Lal
previous month october 2006 next month
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today