• 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: Compositing NSImages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compositing NSImages


  • Subject: Re: Compositing NSImages
  • From: Marco Binder <email@hidden>
  • Date: Sat, 28 Sep 2002 18:20:44 +0200

hi,

I dont really get exactly what you want. You want to composite them one over the other with some degree of transparency, or you want to draw them at different positions one below the other?

doesnt really matter what you want, the approach will be about the same:

look into NSImage documentation, especially at

- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(float)delta

You lock focus on your target image and then call this method on each of your source images. The first (dstRect) NSRect specifies where you want to draw it, the second (srcrect) NSRect specifies from where in your source Image to take the rect (so probaly the whole image, right). NSCompositingOperation would most probably be NSCompositeCopy in both cases. Fraction specifies the transparency (1.0 is fully opaque).

So for one over the other, you would always give the same dstRect but use a fraction below 1.0.

For drawing them one below the other, you just have to shift dstRect down appropriately for each image.

Note: if dstRect and srcRect arent of same dimensions, it will be scaled automatically.

hope that helps,

marco


Am Samstag, 28.09.02 um 06:37 Uhr schrieb Jan Van Tol:

List,

I would like to be able to take several images and combine them all in to one. I would start with several (probably four or five) NSImages, which I would composite on to a target NSImage. The end result should be the target image looking like all of the source images displayed in series (moving downwards). Can someone suggest a way to do this? Many thanks in advance,


--
|\ /| E-Mail: email@hidden WWW: www.marco-binder.de
| \/ | Telefon: 07531 / 94 19 94 Fax: 07531 / 94 19 92
| |ARCO Snail-Mail: Banater Str. 3 - 78467 Konstanz
BINDER _____________________________________________________
_______________________________________________
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.

References: 
 >Compositing NSImages (From: Jan Van Tol <email@hidden>)

  • Prev by Date: Re: NSImageView scrolling
  • Next by Date: Re: NSImageView scrolling
  • Previous by thread: Compositing NSImages
  • Next by thread: [Newbie] Document Format Advice
  • Index(es):
    • Date
    • Thread