Skip navigation.
 
mlRe: NSImageRep Trouble
FROM : Seth Willits
DATE : Sat Nov 23 16:37:18 2002

On 11/22/02 7:06 PM, the NSA intercepted the following message from "David
Remahl" <<email_removed>>:

> Here you need the full path to the image.
>
> NSString *path = [[NSBundle mainBundle] pathForResource:@"Image"
> ofType:@"tiff"];
> imageRep = [[NSImageRep imageRepWithContentsOfFile:path] retain];


Darn. I just can't get this to work:



- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Image"
ofType:@"tiff"];
       
    image = [[[NSImage alloc] initWithContentsOfFile:path] retain];
    imageRep = [[image bestRepresentationForDevice:nil] retain];

    ...
    return self;
}


- (void)animateOneFrame
{
    ...
    [imageRep drawAtPoint:point];
    return;
}



Each time, imageRep is nil and nothing is drawn. I tried to get the file and
draw it with only an imageRepresentation but that didn't work so I tried
using and NSImage to get and NSImageRep that was valid, but this is still
not working,


    I appreciate the help,




Seth Willits
---------------------------------------------------------------------------
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com

"If God did not exist, it would be  necessary to invent Him."
        -- Voltaire
---------------------------------------------------------------------------
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlNSImageRep Trouble Seth Willits Nov 23, 03:58
mlRe: NSImageRep Trouble David Remahl Nov 23, 04:06
mlRe: NSImageRep Trouble Seth Willits Nov 23, 16:37
mlRe: NSImageRep Trouble Scott Anguish Nov 24, 09:13
mlRe: NSImageRep Trouble Seth Willits Nov 24, 19:25