• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Draw a non-antialiased image (NSImage)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Draw a non-antialiased image (NSImage)


  • Subject: Re: Draw a non-antialiased image (NSImage)
  • From: Conrad Shultz <email@hidden>
  • Date: Fri, 28 Oct 2011 18:35:01 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/26/11 1:17 AM, Nick wrote:
> hi I have a 2x2 px png image which represents a line element. I am
>  drawing this "line" by drawing vertically repeatedly these line
> elements. The problem is, when I resize the window, I get this
> line's width "doubled" (probably, because of antialiasing) and the
>  line appears blurred. Is there a way I could disable this
> "antialiasing" (or whatever it is?). Thank you
>
> int borderSize = 2;
>
> [line drawAtPoint:NSMakePoint([self bounds].size.width-borderSize,
> totalHeight-(borderSize/2 + borderSize+i*borderSize))
> fromRect:NSMakeRect(0, 0, borderSize, borderSize)
> operation:NSCompositeSourceAtop fraction:1.0];

You're iterating over the length of the line?

If so, I think you are overengineering this.  Have you investigated
whether CGPattern will accomplish what you want?  (There is a thorough
section in the Quartz 2D Programming Guide that you will probably find
more useful than the somewhat sparse class documentation.)

My guess is that using an API designed for tiling will not only
alleviate various artifacts that may be introduced in other methods
but will probably give superior performance (and make for more
readable code).

- --
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOq1hEaOlrz5+0JdURAoWaAJsGEvouo0WvP0hKoF3ThQMdq4/3UgCfUF2e
PEZBFja6yE645be+FxjQ2FM=
=VCS/
-----END PGP SIGNATURE-----
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Draw a non-antialiased image (NSImage) (From: Nick <email@hidden>)

  • Prev by Date: Draw a non-antialiased image (NSImage)
  • Next by Date: ALAssetsLibrary and iOS5
  • Previous by thread: Draw a non-antialiased image (NSImage)
  • Next by thread: Re: Draw a non-antialiased image (NSImage)
  • Index(es):
    • Date
    • Thread