On 2/17/06, Stefan Urbanek <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> Does anyone have a primitive working example for drawing a TIFF image? I want
> to
> use standard drawing methods, such as NSBezierPath.
>
> I suppose there should be some combination of NSBitmapImageRep and
> NSGraphicsContext... But how? Is there any application doing that so I can
> look
> at the code?
>
> Thanks for any hints,
>
> Stefan Urbanek
> --
> http://stefan.agentfarms.net
>
> First they ignore you, then they laugh at you, then they fight you, then
> you win.
> - Mahatma Gandhi
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
Try this:
- (void) someMethodToSaveView: (NSView *) view toTIFF: (NSString *) path
{
NSBitmapImageRep * rep = [NSBitmapImageRep alloc];
NSImage * image = [NSImage alloc];
NSFileHandle * file;
[view lockFocus];
[rep initWithFocusedViewRect: [view frame]];
[view unlockFocus];
[image initWithSize: [view frame].size];
[image addRepresentation: rep];
RELEASE (rep);
file = [NSFileHandle fileHandleForWritingAtPath: path];
[file writeData: [image TIFFRepresentation]];
RELEASE (image);
};
--
Besos, abrazos, confeti y aplausos.
Jamie Ramone
"El Vikingo"
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep