URL:
  <http://savannah.gnu.org/bugs/?34470>

                 Summary: -[NSBitmapImageRep initWithFocusedViewRect:] broken
                 Project: GNUstep
            Submitted by: julian_
            Submitted on: Mo 03 Okt 2011 23:51:30 GMT
                Category: Gui/AppKit
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

the following method to obtain the "raw" bytes of a NSImage does work on Cocoa
but not on GNUstep (inline posting may eat two obvious asterisks) - the
resulting data buffer is all zero:

NSImage *theImg = [[NSImage alloc] initWithContentsOfURL:_url]; 

[theImg lockFocus]; 

NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:NSMakeRect(0.0, 0.0, [theImg size].width, [theImg
size].height)]; 

[theImg unlockFocus]; 

char *_data = (char *)calloc( [theImg size].width * 4 * [theImg size].height,
1); 
memcpy(_data, [bitmap bitmapData], [theImg size].width * 4 * [theImg
size].height); 






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34470>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to