Professional Web Applications Themes

Drawing with XOR in Cocoa - Mac Programming

Hi, I'm writing a Cocoa application and I need to draw an ellipse on a NSView using XOR, so that if I draw the same ellipse again, it would restore the original colors. With QuickDraw, I was able to use "PenMode(patXor)", but I don't know how to do it in the Cocoa environment. Thanks in advance for your help....

  1. #1

    Default Drawing with XOR in Cocoa

    Hi,

    I'm writing a Cocoa application and I need to draw an ellipse on a
    NSView using XOR, so that if I draw the same ellipse again, it would
    restore the original colors. With QuickDraw, I was able to use
    "PenMode(patXor)", but I don't know how to do it in the Cocoa
    environment.

    Thanks in advance for your help.
    Igor Guest

  2. #2

    Default Re: Drawing with XOR in Cocoa

    Igor Carajo <com> wrote:
     

    So you're saying that none of the drawing modes at the top of this page
    will do?

    file:///Developer/Doentation/Cocoa/Reference/ApplicationKit/ObjC_clas
    sic/Classes/NSImage.html

    ???

    m.

    --
    matt neuburg, phd = com, http://www.tidbits.com/matt/
    AppleScript: The Definitive Guide
    http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
    Read TidBITS! It's free and smart. http://www.tidbits.com
    matt Guest

  3. #3

    Default Re: Drawing with XOR in Cocoa

    dans l'article 1gfl0bb.emfulh1gkgdz6N%com, matt neuburg à
    com a écrit le 19/06/04 0:04:
     
    >
    > So you're saying that none of the drawing modes at the top of this page
    > will do?
    >
    > file:///Developer/Doentation/Cocoa/Reference/ApplicationKit/ObjC_clas
    > sic/Classes/NSImage.html
    >
    > ???[/ref]

    NSCompositeXOR

    BUT

    Exclusive OR of source and destination images. Works only with black and
    white images and is not recommended for color contexts.

    The way to do this with modern computers is to simply redraw the NSView.

    Eric

    Eric Guest

Similar Threads

  1. Drawing in Flex? Drawing and AS for custom compon
    By yoway in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: April 18th, 10:19 PM
  2. C++ in cocoa
    By Robert in forum Mac Programming
    Replies: 6
    Last Post: February 26th, 07:19 PM
  3. Considering Cocoa Books
    By David in forum Mac Programming
    Replies: 10
    Last Post: January 31st, 09:54 PM
  4. Cocoa + Xcode + GMP = What the?
    By M in forum Mac Programming
    Replies: 11
    Last Post: November 22nd, 11:46 PM
  5. Cocoa Filemaker
    By Olly Groves in forum FileMaker
    Replies: 2
    Last Post: July 25th, 01:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139