Tuesday, 15 March 2011

objective c - Specific behaviour wanted when loading and displaying an image in an NSScrollView (Mac OS X) -



objective c - Specific behaviour wanted when loading and displaying an image in an NSScrollView (Mac OS X) -

i unexperienced , rather new objective-c , i'd inquire methodical question. want is:

load user provided image show on screen. user should able zoom. seems best me utilize nsscrollview draw image. have other demands behavior when image loaded, should fit nsscrollview without beingness stretched in either direction. when user changes size of nsscrollview (via changing size of window) image should resized appropriately. if user @ point zooms image, shall not resized when changing size of nsscrollview. if image zoomed fit nsscrollview (means when loaded) should resized 1 time again when changing size of nsscrollview. think same behavior in apple's preview app.

i guess easy accomplish experienced programmer, have issues. here's have tried.

i load image via

[[nsimage alloc] initwithcontentsoffile:imagepathstr];

on button click. able displayed fit nicely (on load) nsscrollview changing size of image before drawing it. can't behavior right on resizing or zoom (i utilize nsscrollview biuld-in zoom ability). can provide kind of list of key points needed executed accomplish want? or rather see explicit code tell me doing wrong?

objective-c nsview nsscrollview

No comments:

Post a Comment