FROM : Hidetomo Katsura
DATE : Thu Dec 23 20:11:48 2004
i figure it out. the following code seems to work on 10.2.8 as well
while printing.
view = [[NSView alloc] initWithFrame:srcRect];
[self addSubview:view];
[view scaleUnitSquareToSize:scaleSize];
[view lockFocus];
[customView drawRect:srcRect];
[view unlockFocus];
[view removeFromSuperview];
[view release];
thanks anyway,
katsura
On Dec 23, 2004, at 9:20 AM, Hidetomo Katsura wrote:
> the following code works fine on 10.3.7 but fails on 10.2.8 while
> printing. i need to scale srcRect down to dstRect to make it fit in
> the page size.
>
> image = [[NSImage alloc] initWithSize:srcRect];
> [image lockFocus];
> [view drawRect:srcRect];
> [image unlockFocus];
> [image drawInRect:dstRect fromRect:srcRect operation:NSCompositeCopy
> fraction:1.0];
> [image release];
>
> how can i scale it down without using NSImage on 10.2.8 while
> printing? any suggestions?
>
> thanks in advance,
> katsura
DATE : Thu Dec 23 20:11:48 2004
i figure it out. the following code seems to work on 10.2.8 as well
while printing.
view = [[NSView alloc] initWithFrame:srcRect];
[self addSubview:view];
[view scaleUnitSquareToSize:scaleSize];
[view lockFocus];
[customView drawRect:srcRect];
[view unlockFocus];
[view removeFromSuperview];
[view release];
thanks anyway,
katsura
On Dec 23, 2004, at 9:20 AM, Hidetomo Katsura wrote:
> the following code works fine on 10.3.7 but fails on 10.2.8 while
> printing. i need to scale srcRect down to dstRect to make it fit in
> the page size.
>
> image = [[NSImage alloc] initWithSize:srcRect];
> [image lockFocus];
> [view drawRect:srcRect];
> [image unlockFocus];
> [image drawInRect:dstRect fromRect:srcRect operation:NSCompositeCopy
> fraction:1.0];
> [image release];
>
> how can i scale it down without using NSImage on 10.2.8 while
> printing? any suggestions?
>
> thanks in advance,
> katsura
| Related mails | Author | Date |
|---|---|---|
| Hidetomo Katsura | Dec 23, 18:20 | |
| Hidetomo Katsura | Dec 23, 20:11 |






Cocoa mail archive

