 |
 |
CoreGraphics ?
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
I want to draw two (or more) NSBitmapImageRep (initialized with jpegs) into another NSBitmapImageRep which is created on the fly using the "initWithBitmapDataPlanes" method. One possibility to do this is creating a core graphics context, core graphics image references and draw them into the context. But I don't like pure c code in my app and would like to know if there's any way to get a NSGraphicsContext from a NSImageRep ? Then I could use the NSImageReps draw method ....
Any ideas ?
[ 05-25-2002: Message edited by: mahrz ]
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status:
Offline
|
|
Create a new NSImage, send it a lockFocus, draw your two NSBitmapImageReps into it, and unlock focus. Now, you've got an NSImage that contains a private subclass of NSImageRep (it's a cached representation). You can get this into an NSBitmapImageRep by again locking focus on your NSImage and initing an NSBitmapImageRep using the initWithFocusedRect method.
Use TIFFRepresentation to get jpg data back out again.
(disclaimer - this is all from memory, I may have gotten names totally freakin' wrong)
|
Geekspiff - generating spiffdiddlee software since before you began paying attention.
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by smeger:
<STRONG>Create a new NSImage, send it a lockFocus, draw your two NSBitmapImageReps into it, and unlock focus. Now, you've got an NSImage that contains a private subclass of NSImageRep (it's a cached representation). You can get this into an NSBitmapImageRep by again locking focus on your NSImage and initing an NSBitmapImageRep using the initWithFocusedRect method.
Use TIFFRepresentation to get jpg data back out again.
(disclaimer - this is all from memory, I may have gotten names totally freakin' wrong)</STRONG>
Is the current graphics context the context of the image when I call lockFocus ?
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |