NSTextView to Image
NSTextView to Image
- Subject: NSTextView to Image
- From: Lorenzo <email@hidden>
- Date: Thu, 15 Jan 2004 18:57:53 +0100
Hi,
I am trying to get an image of a NSTextView so I can later reopen the image
with Photoshop. The problem is that the image I get has a white background.
Instead I need it transparent. I did:
---------------------------
NSRect textRect = NSMakeRect (0.0f, 0.0f, theWidth, theHeight);
NSTextView *textView = [[NSTextView alloc] initWithFrame:textRect];
[textView setBackgroundColor:[NSColor clearColor]];
[textView setDrawsBackground:NO];
[textView setString:@"abcde"];
NSData *pdfData = [textView dataWithPDFInsideRect:[textView bounds]];
[textView release];
NSBitmapImageRep *bitmap;
bitmap = [[NSBitmapImageRep alloc] initWith
Data:pdfData];
---------------------------
What did cause the background color be white? Is it the pdfData?
How to get the image with a transparent background?
Thank you.
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.