discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extracting from NSImage (NSImageView)


From: Andreas Hoeschler
Subject: Re: Extracting from NSImage (NSImageView)
Date: Thu, 3 Jun 2004 23:18:08 +0200

Hi Vaisburd,

I do not whether NSImageView can be used for this purpose,
but, as far as I understand, cropping is the job of NSImage class.

Thanks for the hint. I finally realized that I made a mistake while calculating the rect for the extraction. It works now with dataWithPDFInsideRect: on Cocoa, but not on GNUstep. Here is what I get

NSPrintOperation (instance) does not recognize initPDFOperatonWithView:insideRect:toData:printInfo:

I think you can use Cocoa's method
[NSImage -compositeToPoint:fromRect:operation:fraction:]

If you want to create an image from a portion of original one,
you need to calculate the new size, create this new image and
then draw _on it_ by locking focus:

[newImage lockFocus];
[originalImage compositeToPoint: ....];
[newImage unlockFocus];

I say "I think" because I never used Cocoa,

On Cocoa this works with

[compositeImage compositeToPoint:NSMakePoint(0,0) fromRect:subFrame operation:NSCompositeCopy];

It does not work or at least produces a different result (what I don't understand) with


[compositeImage drawAtPoint:NSMakePoint(0,0) fromRect:subFrame operation:NSCompositeCopy fraction:1];

This does not work on GNUstep though! :-(

and
[NSImage -compositeToPoint:fromRect:operation:fraction:]
was not implemented in GNUstep the last time I checked.

Does anybody know why it's not implemented?

Both methods still aren't implemented (latest snapshot). Is anybody actually working on this? Is there any other approach to accomplish - compositing images and extracting a subregion - on GNUstep?

Thanks!

Regards,

Andreas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]