• 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
NSImage display
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage display


  • Subject: NSImage display
  • From: Dan Huntsinger <email@hidden>
  • Date: Sat, 24 Nov 2001 19:39:05 -0800

Hi all, just want to say thanks to all of you who have helped me thus far.
I've made so much progress, much thanks to this group.

My question this time deals with displaying images, and shouldn't be too
hard to answer. I have some tiff images that I need to display in my
program, and so far I've been displaying them in an NSImageView, using
NSScaleToFit to make the image fit perfectly inside of the NSImageView box I
created in IB.

The first thing I'd like to change about this is I'd like to display an
image using methods in NSImage instead of using an NSImageView. I want to
do this because eventually I want to be able to "animate" the picture
sliding from one point to another. I don't believe that I can do this with
NSImageView because there is no way to change the screen position. Before I
can get to the animation stage however, I need to figure out how to draw the
image on screen. I'm kind of confused about this whole image cache thing,
but I think I'm getting the hang of it. I have this code so far that is not
working:

title = [[NSBundle mainBundle] pathForImageResource:@"aTiffImage"];
tempImage = [[NSImage alloc] initWithContentsOfFile:title];
[tempImage setSize:theSize];
[tempImage compositeToPoint:NSMakePoint(0,0) operation:NSCompositeCopy];

This code doesn't really do anything.

So, what I need to do, is be able to display this image at a certain point,
and then after a specified delay, display it a little to the left, and so
on, making it appear to slide across the screen.

Can any of you comment on my approach, point me to any examples, or help me
out at all?

Thanks,
Dan


  • Prev by Date: Re: Setting an Outlet to an NSTextView in IB, it seems to get the NSScrollView instead.
  • Next by Date: Re: buddy windows
  • Previous by thread: Re: NSString and gdb
  • Next by thread: Loading Bitmaps with Transparency (Newbie)
  • Index(es):
    • Date
    • Thread