• 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
Not even a portion of a window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Not even a portion of a window?


  • Subject: Not even a portion of a window?
  • From: Lorenzo <email@hidden>
  • Date: Fri, 15 Jul 2005 19:20:30 +0200

H,
why can't I get an image of my window?
I get an empty image all the time. What did I miss?

    NSRect        imageRect = [[aWindow contentView] bounds];
    NSSize        imageSize = imageRect.size;
    NSData        *imageData = nil;

    NSImage *image = [[NSImage alloc] initWithSize:imageSize];
    [image lockFocus];
        [[aWindow contentView] drawRect:imageRect];
        imageData = [image TIFFRepresentation];
    [image unlockFocus];

    [imageData writeToFile:@"/a_image_%d.tiff" atomically:YES];
    [image release];

Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Not even a portion of a window?
      • From: Troy Stephens <email@hidden>
    • Re: Not even a portion of a window?
      • From: j o a r <email@hidden>
  • Prev by Date: ignoring double clicks
  • Next by Date: Re: Not even a portion of a window?
  • Previous by thread: Re: ignoring double clicks
  • Next by thread: Re: Not even a portion of a window?
  • Index(es):
    • Date
    • Thread