eastercow
eastercow

Reputation: 15

Move NSImage inside NSImageview

I'm new to Cocoa and kinda trying to create a timer.

I'm trying to move the NSImage inside the NSImageview up or down based on a timer.

Here is how I load the image inside the NSImageview:

NSRect fnRect = NSMakeRect(10 + (wheelWidth / 4) - 5, 30, numbersWidth, wheelHeight);
fnImageView = [[NSImageView alloc] initWithFrame:fnRect];
[fnImageView setImageScaling:NSScaleNone];
[fnImageView setImage:numbers];
[self addSubview:fnImageView];

If anyone can point me to a tutorial or give me a hint about how to do it I would appreciate it. Thanks.

Upvotes: 0

Views: 834

Answers (2)

Fabio Poloni
Fabio Poloni

Reputation: 8371

Inside a NSImageView isn't a NSImage. It's just used to show the NSImage.

What you want to do is probably a NSImageView inside a NSView where you could move it around.

  1. Create a new NSView
  2. Put an NSImageView in it
  3. Move the NSImageView around.

Upvotes: 2

Related Questions