Image not updated
Image not updated
- Subject: Image not updated
- From: Robert Cerny <email@hidden>
- Date: Sat, 20 Jan 2007 18:29:59 +0100
Hi folks,
I have got a trouble while drawing a string over an image.
NSImage *myImageFile = [[NSImage alloc] initWithContentsOfFile:path];
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
NSFont *font = [[NSFontManager sharedFontManager]
fontWithFamily:@"Lucida Grande" traits:0 weight:1.0 size:150];
[attrs setObject:font forKey:NSFontAttributeName];
[attrs setObject:[NSColor redColor]
forKey:NSForegroundColorAttributeName];
[myImageFile lockFocus];
NSAttributedString *astr = [[NSAttributedString alloc]
initWithString:@"Sample" attributes:attrs];
[astr drawAtPoint:NSZeroPoint];
[myImageFile unlockFocus];
It looks well from my point of view and when I save the image using
[[myImageFile TIFFRepresentation] writeToFile.... I get the correct
image.
However, it looks like the contents in memory doesn't contain the
string. I tried to use [myImageFile recache] to update it but no way.
I'm using IconFamily to draw a thumbnail and the icon I get is empty.
id iconFamily = [IconFamily
iconFamilyWithThumbnailsOfImage:myImageFile];
[iconFamily setAsCustomIconForFile:path withCompatibility:YES];
Does anyone know, where could be a problem?
Thanks
Robert
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden