bugGNUstep - Bugs: bug #15837, Locking focus on NSImage with...

Group
 
 

bug #15837: Locking focus on NSImage with Bitmap image rep does not work

Submitter:  Stefan Urbanek <stefanu>
Submitted:  Tue 21 Feb 2006 08:40:29 AM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Feb 2006 08:40:29 AM UTC, original submission:  

Following example does not work:

/* Create bitmap image representation */
   rep = [[NSBitmapImageRep alloc]
           initWithBitmapDataPlanes: nil
           pixelsWide: size.width pixelsHigh: size.height
           bitsPerSample: 8 samplesPerPixel: 3
           hasAlpha: NO isPlanar: NO
           colorSpaceName: NSCalibratedRGBColorSpace
           bytesPerRow: 0 bitsPerPixel: 24];

   image = [[NSImage alloc] initWithSize: size];
   [image addRepresentation: rep];

/* Draw image */

   [image lockFocusOnRepresentation:rep];
   [[NSColor blackColor] set];
   [NSBezierPath fillRect:NSMakeRect(10,10,80,80)];
   [image unlockFocus];

at this point the NSBitmapImageRepresentation (rep) stays unchanged, as all changes were made to cached representation created by lockFocusOnRepresentation: and were not flushed by [image unlockFocus].

I set severity of this problem to "Normal", however I would set it to "Blocking" as it is blocking to applications wanting to draw inside a bitmap image. There is no workaround for the problem. Not even if you want transparent bitmap with incremental changes.

Stefan Urbanek <stefanu>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code