• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Image not updated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Image not updated
      • From: "I. Savant" <email@hidden>
    • Re: Image not updated
      • From: j o a r <email@hidden>
  • Prev by Date: CoreData Migration, Permanent Stores, and Temporary Files
  • Next by Date: Redrawing in a custom NSView.
  • Previous by thread: CoreData Migration, Permanent Stores, and Temporary Files
  • Next by thread: Re: Image not updated
  • Index(es):
    • Date
    • Thread