New topic: Cocoa: AntiAliasing broken for masked pictures
<http://forums.realsoftware.com/viewtopic.php?t=47968> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message tomis Post subject: Cocoa: AntiAliasing broken for masked picturesPosted: Fri May 24, 2013 11:22 pm Joined: Thu Jul 27, 2006 6:31 pm Posts: 1690 Location: Monterey, CA RealStudio 2012r2.1, OS X 10.8.3 1. Start a new project 2. Place the below code in the Paint event of the main Window 3. Compile it as Carbon and run. The image will be anti-aliased just fine. 4. Compile it as Cocoa and run. The image will be an unbearable mess. Has anyone else experienced this or found a fix for this behavior under Cocoa? EDIT: The current work-around is to pre-composite masked Pictures onto non-masked Pictures. Pictures without modified masks anti-alias just fine. Thank you. dim p as Picture p=new Picture(512,512,32) p.Graphics.FillRect 0,0,p.Width,p.Height p.Mask.Graphics.ClearRect 0,0,p.Width,p.Height p.Mask.Graphics.TextSize=100 p.Mask.Graphics.DrawString "This is an AntiAlias Test",0,p.Mask.Graphics.TextAscent,p.Width p.Mask.Graphics.DrawRect 0,0,p.Width,p.Height g.DrawPicture p,0,0,64,64, 0,0,p.Width,p.Height _________________ ImagePlay Effects Library (40+ image effects in one open source module. No plugins, no dependencies, no restrictions.) http://imageplay.sourceforge.net/ Top rowlands Post subject: Re: Cocoa: AntiAliasing broken for masked picturesPosted: Sat May 25, 2013 12:04 am Joined: Fri Sep 30, 2005 11:00 am Posts: 583 Location: Beautiful Taiwan There is another workaround, which is to grab the underlying CGBitmapContextHandle from the Graphics object to set the 'CGContextSetInterpolationQuality' to 3 ( High Quality ). Declare Sub CGContextSetInterpolationQuality lib "Cocoa" (handle as integer, inValue as integer) CGContextSetInterpolationQuality( handle, 3 ) _________________ Sam Rowlands rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012 http://www.ohanaware.com/ AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/ Top tomis Post subject: Re: Cocoa: AntiAliasing broken for masked picturesPosted: Sat May 25, 2013 12:32 am Joined: Thu Jul 27, 2006 6:31 pm Posts: 1690 Location: Monterey, CA rowlands wrote:There is another workaround [â¦] Thank you so much! After reading Apple's Documentation I've decided to go with the faster Interpolation they introduced in OS X 10.6 My code is as follows, called in the paint event. (For anyone else reading this, note that g is a graphics context.) Declare Sub CGContextSetInterpolationQuality lib "Cocoa" (handle as integer, inValue as integer) CGContextSetInterpolationQuality( g.Handle(Graphics.HandleTypeCGContextRef), 4 ) I can only hope Xojo does this automatically on the backend. It's a serious oversight not to do so. _________________ ImagePlay Effects Library (40+ image effects in one open source module. No plugins, no dependencies, no restrictions.) http://imageplay.sourceforge.net/ Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ]
-- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
