• 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
Re: NSImage copy from custom view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage copy from custom view


  • Subject: Re: NSImage copy from custom view
  • From: Ian was here <email@hidden>
  • Date: Wed, 22 Jun 2005 20:44:02 -0700 (PDT)

Something like this...



NSBitmapImageRep			*bmRep;
NSImage                                   *newImage =
[[NSImage alloc] initWithSize[myView bounds]];

// Copy bits from my view into a bitmap image
representation.

[myView lockFocus];
bmRep = [[NSBitmapImageRep alloc]
initWithFocusedViewRect [myView bounds]];
[myView unlockFocus];



// Draw the bitmapped  view image into the new image.

[newImage lockFocus];
[bmRep drawAtPoint:NSMakePoint( 0.0, 0.0 );
[newImage unlockFocus];


[bmRep release];




--- Michael Carter <email@hidden> wrote:

> Hello all... quick question for the group:
>
> I have composited a couple images into a custom
> NSView. Now I'd like
> to take a 150x150px area from the composite and copy
> that into an
> NSImage that I can save to a file. How does one go
> about copying bits
> from one view into another NSImage?
>
> Thanks in advance.
> _________________________
> Mike Carter
> Aviate.Org :: Systems Admin
> iChat: PilotMike :: PGP-0x71E5B44C
>
> >  _______________________________________________
> 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




__________________________________
Discover Yahoo!
Get on-the-go sports scores, stock quotes, news and more. Check it out!
http://discover.yahoo.com/mobile.html
 _______________________________________________
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: NSImage copy from custom view [Solved]
      • From: Michael Carter <email@hidden>
References: 
 >NSImage copy from custom view (From: Michael Carter <email@hidden>)

  • Prev by Date: NSImage copy from custom view
  • Next by Date: vImage problems in Tiger
  • Previous by thread: NSImage copy from custom view
  • Next by thread: Re: NSImage copy from custom view [Solved]
  • Index(es):
    • Date
    • Thread