• 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: Combining two NSImages into one
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Combining two NSImages into one


  • Subject: Re: Combining two NSImages into one
  • From: Greg Casey <email@hidden>
  • Date: Mon, 28 Oct 2002 21:37:48 -0500

I think this will work:

NSSize mySize;

mySize.width = [image1 size].width + [image2 size].width;
mySize.height = ([image1 size].height > [image2 size].height : [image1 size].height : [image2 size].height);

myImage = [[NSImage alloc] initWithSize: mySize];

[myImage lockFocus];
[image1 compositeAtPoint:NSMakePoint(0,0) operation: NSCompositeCopy];
[image2 compositeAtPoint:NSMakePoint([image1 size].width, 0) operation: NSCompositeCopy];
[myImage unlockFocus];

-gtc


On Monday, October 28, 2002, at 05:51 PM, Ali Lalani (list) wrote:

If i have two NSImages of the same sizes, what would be the best way to put them together, side by side, into one single NSImage?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: How to implement font bigger/smaller buttons?
  • Next by Date: Re: Newbie questions (I'm SO confused)
  • Previous by thread: Combining two NSImages into one
  • Next by thread: Re: Combining two NSImages into one
  • Index(es):
    • Date
    • Thread