Re: Image loaded/displayed at the wrong size
Re: Image loaded/displayed at the wrong size
- Subject: Re: Image loaded/displayed at the wrong size
- From: Shawn Erickson <email@hidden>
- Date: Sat, 15 Feb 2003 12:05:34 -0800
On Saturday, February 15, 2003, at 10:50 AM, Shawn Erickson wrote:
On Saturday, February 15, 2003, at 10:39 AM, Henri Hansen wrote:
But the dimensions of the shown picture are always too
small eg. a picture that should be 512 pixels wide is only some 200
pixels
wide.
In my codeI'm opening a picture by (as test picture I'm using a tif)
theImage = [[NSImage alloc]initWithData:someData]
But the image is shown at the wrong size.
Does the image file correctly describe it's dimensions or desired
dimensions? Most likely but sometime that can be the source of a
problem.
You didn't exactly say how you are drawing the image... is the thing
you are drawing into only 200 pixels wide?
I put together a simple application to show what is one possible
solution (you could use a scroll view instead, etc.) to the issue, that
I think, you are seeing. This is a simple app that doesn't do some of
the screen bounds and error checking needed, etc. It is just an example.
Simply drop a picture onto the applications window to get it displayed.
Application
http://homepage.mac.com/~shawnce/dev/examples/image_draw.app.tgz
Source/Project
http://homepage.mac.com/~shawnce/dev/examples/image_draw.tgz
-Shawn
_______________________________________________
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.