Re: Problem with paths and images
Re: Problem with paths and images
- Subject: Re: Problem with paths and images
- From: Ronny Reichmann <email@hidden>
- Date: Tue, 19 Dec 2006 18:47:46 +0100
I did read you mail ones more. Why do you want to draw to that small
image and than scale it up to nearly ten times the size? This will
run you into quality problems!
Do you think it would be done faster that way? Every drawing
operation is double buffered.
Yust set your color and draw your rectangle. Thats all you have to
think about. Quartz will do the rest for you.
If you want to do it your way either, turn off anti aliasing in the
graphics context.
Am 19.12.2006 um 16:59 schrieb Livio Isaia:
The problem is that I draw (NSBezierPath stroke method) a black
rect path in an image with locked focus, and then I draw the image
in a rect bigger than the image's size. I'd expect a big black rect
drawn, but get a very different result (see figure please): the
color seems gray, not black, it seems transparent and shouldn't be,
it's two times thicker, has dark little rects at the vertexes etc..
The code is:
... after created the image and the path...
... and supposing the image bounds are (0, 0, 32 32) and the
view bounds (0, 0, 256, 256)...
[path appendBezierPathWithRect:NSMakeRect(6, 6, 20, 20)];//for
example...
[image lockFocus];
[image clearImage];
[pathColor set];
[path stroke];
[image unlockFocus];
then in a view's draw method:
[image drawInRect:[self bounds] fromRect:[image sourceRect]
operation:NSCompositeSourceOver fraction:1.0];
([image sourceRect] simply returns the image bounds; [image
clearImage] simply fills with clearColor the image bounds)
Can anyone tell me something about (why the black rect is not
merely a rect)?
Sorry if I'm tedious with too much code...
Many thanks to all of you,
livio.
<Bigger black rect.tiff>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden