Coolsville.
I just found out there's a better way to save image files...using...
- (IBAction)saveImage: (id)sender
{
NSSavePanel * savePanel = [NSSavePanel savePanel];
mSaveOptions = [[IKSaveOptions alloc]
initWithImageProperties: mImageProperties
imageUTType: mImageUTType];
[mSaveOptions addSaveOptionsAccessoryViewToSavePanel: savePanel];
NSString * fileName = [[mWindow representedFilename] lastPathComponent];
[savePanel beginSheetForDirectory: NULL
file: fileName
modalForWindow: mWindow
modalDelegate: self
didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
contextInfo: NULL];
}
Though I haven't worked it up yet...if it will work. Adds all the options and save types I was trying to do earlier in one fell swoop! No more Quicktime and other file save antiques
rc
On Jan 28, 2012, at 1:48 AM, Robert Purves wrote:
>
> Just a reminder that there's a better way to create a CGImage from a file.
> This works for any graphics file, without kludgy kode testing for ".jpg" and ".png"
>
>
> local fn CreateCGImageFromBundleResource( fileName as CFStringRef ) as CGImageRef
> '~'1
> dim as CFURLRef url
> dim as CGImageRef image : image = NULL
> dim as CGImageSourceRef source
>
> url = fn CFBundleCopyResourceURL( fn CFBundleGetMainBundle(), fileName, NULL, NULL )
> if ( url )
> source = fn CGImageSourceCreateWithURL( url, NULL )
> if ( source )
> image = fn CGImageSourceCreateImageAtIndex( source, 0, NULL )
> CFRelease( source )
> end if
> CFRelease( url )
> end if
> end fn = image
>
>
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> To access the list archives, go to: http://freegroups.net/groups/futurebasic/
>