Professional Web Applications Themes

Drawing Text... - Mac Programming

Hello all, I have a few questions to ask regarding drawing in Cocoa. I am drawing onto an NSImage, and then adding this image to my subclass of NSView, which draws the image onto itself. 1. I wish to draw text, but the Cocoa developer doentation says that "This topic is under construction". I had a quick search on the Internet for a tutorial, or something, but it has been in vain. I was wondering if anyone here could point me to a good source. I have Aaron Hillegass' book "cocoa Programming For Mac OS X" containing the TypingTutor tutorial, ...

  1. #1

    Default Drawing Text...

    Hello all,
    I have a few questions to ask regarding drawing in Cocoa.

    I am drawing onto an NSImage, and then adding this image to my subclass
    of NSView, which draws the image onto itself.

    1. I wish to draw text, but the Cocoa developer doentation says that
    "This topic is under construction". I had a quick search on the
    Internet for a tutorial, or something, but it has been in vain. I was
    wondering if anyone here could point me to a good source. I have Aaron
    Hillegass' book "cocoa Programming For Mac OS X" containing the
    TypingTutor tutorial, but I would like a few more sources. ;-)

    2. I have been using an NSBezierPath for drawing lines and curves,
    etc., but how would I go about drawing curves for say, a mathematical
    function or something? For example, if I have a bunch of (x, y) data
    points.
    I know the curve stuff in NSBezierPath is based on cubic polynomials,
    using the derivatives, (slope), at points (x1, y1) and (x2, y2) for a
    curve between these points. It seems a bit overkill, though. I can do
    it, but I thought I would ask if anyone has done this via some easier
    method.
    I could go into polynomial interpolation, (numerical methods), and this
    may be my best choice...

    These NSImages I'm drawing, will only be created once, and fed to my
    sublassed NSView, which will simply do this:
    [image drawInRect: fromRect: operation: fraction:1.0];

    3. How can I get the JPEG or PICT or GIF data representation of an
    NSImage that can be saved iinto JPEG, PICT, or GIF format, respectively?
    I know it has something to do with NSBitmapImageRep, but the
    doentation is a little, (a lot), vague on this. Pointers to any good
    sources on this topic would also be appreciated.

    Thanks in advance. MB.
    M Guest

  2. #2

    Default Re: Drawing Text...

    In article <1g2cz1m.1565lck1uyzwccN%com>,
    com (M) wrote:
     

    Look under NSString Additions in the Application Kit doentation.


    Simon Guest

  3. #3

    Default Re: Drawing Text...

    M <com> wrote: 

    Is the drawing of text already fixed? The Cocoa Programming book by
    Anguish, Buck and Yacktman talks about it (p571,575).

    Stephan
    Stephan Guest

Similar Threads

  1. Drawing in 3D
    By JamieCrow in forum Macromedia Director 3D
    Replies: 2
    Last Post: January 25th, 10:00 AM
  2. Drawing API
    By FluidBrix in forum Macromedia Flash Data Integration
    Replies: 1
    Last Post: November 8th, 10:33 PM
  3. 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
  4. how to add text to vectoral drawing(logo)
    By alan1977 webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 1
    Last Post: December 30th, 03:50 PM
  5. Drawing a 3D net
    By hsehm webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 3
    Last Post: December 1st, 08:09 PM

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