Projects

Ticket #818 (new defect)

Opened 19 months ago

Last modified 14 months ago

NSBitmapImageRep#bitmapData returns empty String

Reported by: emil@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby Later
Component: MacRuby Keywords: bitmap,NSBitmapImageRep, @nsBitmapImageRepObj.bitmapData
Cc:

Description (last modified by eloy.de.enige@…) (diff)

after allocating an NSBitmapImageRep with

@nsBitmapImageRepObj = NSBitmapImageRep.alloc.initWithBitmapDataPlanes nil,
                    pixelsWide:200,
                    pixelsHigh:200,
                    bitsPerSample:8,
                    samplesPerPixel:3,
                    hasAlpha:false,
                    isPlanar:false,
                    colorSpaceName:"NSCalibratedRGBColorSpace",
                    bytesPerRow:0,
                    bitsPerPixel:0

@nsBitmapImageRepObj.bitmapData returns an empty String, with size zero.

Attachments

MyView.rb Download (1.4 KB) - added by emil@… 19 months ago.

Change History

Changed 19 months ago by emil@…

Changed 19 months ago by eloy.de.enige@…

  • description modified (diff)

Changed 19 months ago by lsansonetti@…

Unfortunately there is little we can do here. -bitmapData returns a "unsigned char *" type and MacRuby assumes this is a string. However, since the first byte is null, the resulted string object is empty.

There are other ways of getting the data. -getPixel:atX:y: for example might work better.

I am leaving this bug open in the idea that we might find a solution for the -bitmapData problem.

Changed 14 months ago by eloy.de.enige@…

  • milestone set to MacRuby Later
Note: See TracTickets for help on using tickets.