On 27/04/2009, at 12:16 , Naresh Kongara wrote:
in the view drawing code i didn't changed any thing.
After preparing the view from which i need to get the images, i just replaced the line

NSImage *img = [[[NSImage alloc] initWithData:[view dataWithPDFInsideRect:sourceRect]] autorelease];

with

        NSImage *img = [view imageFromRect:sourceRect];



The view drawing is same for both the cases,
but -(NSImage *)imageFromRect:(NSRect) is giving me a some what blurred image...


My guess (and its only a guess because you haven't posted the drawing code) is that the image is being drawn at a different size to the original, and hence scaling.

cacheDisplayInRect will return a bit map image which will be blurry if scaled.

dataWithPDFInsideRect will (potentially at least) return a PDF image which will scale better.

Check your drawing code and ensure it is drawing the image at exactly the same size as the original view bounds.

You can also try writing both images to a pdf and tiff and seeing the differences.

Enjoy,
   Peter.

--
     Run macros from your iPhone with Keyboard Maestro Control!
         or take a break with Derzle for your iPhone

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
Aragom Space War <http://www.stairways.com/iphone/aragom> Don't get killed!
Derzle <http://www.stairways.com/iphone/derzle> Enjoy a relaxing puzzle.
<http://www.stairways.com/>           <http://download.stairways.com/>




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to