Originally posted by Apocalypse:
<STRONG>I can't really help you with the NSBezierPath issues right now (I haven't used them in some time) but I do know that you can save an image to a gif if you can get an NSBitmapImageRep from it. Using the NSBitmapImageRep you can then call:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> - (NSData *)representationUsingType

NSBitmapImageFileType)storageType properties

NSDictionary *)properties</font>[/code]
with "NSGIFFileType" as the storageType and nil (I think) for properties. You will have to look into more of what the properties dictionary needs to be since I don't have my code with me right now where I did this.
Hope that is of some help,
Jeff.</STRONG>
[Yes, that definitely helps... So I am looking at something like:
[[myBitmapImageRep representationUsingType:NSGIFFileType, properties:nil] writeToFile:@"/users/synotic/preview.gif" atomically:YES ]
right?
Now here's what I come up with various help...
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>- (IBAction)generatePreview

id)sender
{
NSImage *previewImage=[[NSImage alloc] init];
[imagewell2 setImage:[imagewell1 image]];
[previewdate setStringValue:[<font color = orange>@"Date: "</font> stringByAppendingString:[formdate stringValue]]];
[previewversion setStringValue:[<font color = orange>@"Version: "</font> stringByAppendingString:[formversion stringValue]]];
[previewsize setStringValue:[<font color = orange>@"Size: "</font> stringByAppendingString:[formsize stringValue]]];
[previewImage lockFocus];
[previewview drawRect:[previewview bounds]];
[previewImage unlockFocus];
[[[previewImage TIFFRepresentation] representationUsingType:NSGIFFileType properties:nil] writeToFile:<font color = orange>@"/Users/synotic/Desktop/previewimage.gif"</font> atomically:YES ];
}</font>[/code]
Now supposedly previewImage is supposed to become the custom view... but right when it tries to do the lockFocus.. I get a "Cannot cache image". Any other ideas how I can get the view to become an image?
Again, thanks!
[ 04-29-2002: Message edited by: Synotic ]