[Top][All Lists]

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

Re: [Gnustep-cvs] Commit Update

From: Fred Kiefer
Subject: Re: [Gnustep-cvs] Commit Update
Date: Mon, 26 Jul 2004 21:32:51 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114

Adam Fedor wrote:
+  image = [NSApp applicationIconImage];
+  rep = (NSBitmapImageRep *)[image bestRepresentationForDevice:nil];
+ + if (![rep isKindOfClass: [NSBitmapImageRep class]])
+    return 0;
+  if ([rep bitsPerSample] != 8
+      || (![[rep colorSpaceName] isEqual: NSDeviceRGBColorSpace]
+         && ![[rep colorSpaceName] isEqual: NSCalibratedRGBColorSpace])
+      || [rep isPlanar])
+    return 0;

Seeing this horrible code being reused once more, makes me ask again when the art backend will be supporting the [initWithFocusedViewRect:] call? With that we could have a much more usefull code (See my last mail on this):

  NSSize size = [image size];

  [image lockFocus];
rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect(0, 0, size.width, size.height)];
  [image unlockFocus];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]