Cracks in image using NSDrawThreePartImage
Hi Folks, I have followed the suggestion in the documentation to use NSDrawThreePartImage to draw an extensible image. The way that I am using it, the image is extensible in the horizontal dimension, and may be resized in the vertical dimension, so the individual component images are rescaled proportionally. That is as I expect and what I am looking for. Unfortunately, when the vertical scale factor is not 1.0, there are (subtle) 1 pixel visual artifacts between the startCap and centerFill images or the centerFill and endCap images. I was under the impression that this API was specifically designed to handle this properly. Is there anything in specific I need to do, or is there a bug in the API's implementation. The code that I am using in my view subclass is as follows: - (void)drawRect:(NSRect)rect { NSRect bnds = [self bounds]; NSDrawThreePartImage(bnds, left, middle, right, NO, NSCompositeSourceOver, 1, NO); } TIA, B.J. Buchalter Metric Halo http://www.mhlabs.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cracks in image using NSDrawThreePartImage
Hi BJ, File a bug with a test case that shows the problem. I would expect there to be seams due to rounding error if you look in pixie, but I have never seen a case where it was visible to the eye at actual scale. -Ken On Wed, May 19, 2010 at 1:41 PM, B.J. Buchalter b...@mhlabs.com wrote: Hi Folks, I have followed the suggestion in the documentation to use NSDrawThreePartImage to draw an extensible image. The way that I am using it, the image is extensible in the horizontal dimension, and may be resized in the vertical dimension, so the individual component images are rescaled proportionally. That is as I expect and what I am looking for. Unfortunately, when the vertical scale factor is not 1.0, there are (subtle) 1 pixel visual artifacts between the startCap and centerFill images or the centerFill and endCap images. I was under the impression that this API was specifically designed to handle this properly. Is there anything in specific I need to do, or is there a bug in the API's implementation. The code that I am using in my view subclass is as follows: - (void)drawRect:(NSRect)rect { NSRect bnds = [self bounds]; NSDrawThreePartImage(bnds, left, middle, right, NO, NSCompositeSourceOver, 1, NO); } TIA, B.J. Buchalter Metric Halo http://www.mhlabs.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com This email sent to kenfe...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cracks in image using NSDrawThreePartImage
On May 19, 2010, at 4:30 PM, Ken Ferry wrote: File a bug with a test case that shows the problem. I would expect there to be seams due to rounding error if you look in pixie, but I have never seen a case where it was visible to the eye at actual scale. I only recall seeing this when the UI scaling factor was something other than 1.0 Could also be the case where you're not drawing on pixel boundaries? ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cracks in image using NSDrawThreePartImage
On Wed, May 19, 2010 at 2:46 PM, Ricky Sharp rsh...@mac.com wrote: On May 19, 2010, at 4:30 PM, Ken Ferry wrote: File a bug with a test case that shows the problem. I would expect there to be seams due to rounding error if you look in pixie, but I have never seen a case where it was visible to the eye at actual scale. I only recall seeing this when the UI scaling factor was something other than 1.0 That still counts as actual scale. I basically mean with the naked eye as opposed to something that shows you the individual pixel colors. Could also be the case where you're not drawing on pixel boundaries? You were correct in the first place that it is tested against this stuff, and part of the point is to handle it. Did you file the bug yet? :-) -Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cracks in image using NSDrawThreePartImage
Hi Ken, File a bug with a test case that shows the problem. Ok -- I filed rdar://8005118 This includes a default configuration that shows the crack clearly. The crack comes and goes as you rescale the window. I would expect there to be seams due to rounding error if you look in pixie, but I have never seen a case where it was visible to the eye at actual scale. This is pretty visible. BTW, this is tested on 10.5.8; even if the problem is fixed on 10.6.x I still need to support older systems, so I am still looking for any suggestions as to how to make this better. Thanks! B.J. Buchalter Metric Halo http://www.mhlabs.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com