Re: UIImage and shadows, WAS: Re: Please if some one knows
Re: UIImage and shadows, WAS: Re: Please if some one knows
- Subject: Re: UIImage and shadows, WAS: Re: Please if some one knows
- From: Development <email@hidden>
- Date: Mon, 21 Dec 2009 19:20:32 -0700
Ok
I was wondering if that was what I was doing wrong. I've tried messing with the size of the context but it gives me trouble. Do I need to adjust the size of the UIImageView also? or since clipping is off is it ok in it's original size?
Also will the drawing to the offscreen context take place at it's center or do I need to set a center and specifically tell the image to draw there? Finally when I call [rotatingView.image drawInRect:rotatingView.bounds blendMode:kCGBlendModeNormal alpha:1.0]; is the rotatingView.bounds the correct rect to draw in to?
On Dec 21, 2009, at 7:09 PM, David Duncan wrote:
> On Dec 21, 2009, at 5:29 PM, Development wrote:
>
>> I'll try my question again. Ok, I have a UIImageView. I am trying to draw a shadow under the UIImage it holds. Now if I make the UIImageView's bounds some ungodly size, like the size of the screen it draws shadows perfectly but obviously this is not acceptable. So I don't understand what I am doing wrong. I've tried turning off the clipstobounds but that doesn't help unless the context I am drawing is is clipping in which case I do not know how to turn it off. But at least in the UIImageView it is not clipping.
>
>
> Your drawing to an offscreen context, and in doing so your asking to create a context that is a certain size. If you draw outside of that area, then your going to lose that drawing, period, because there is no place to put it.
>
> If you want to add a shadow, your going to have to calculate how much extra space you need and increase the context you draw by that size. A reasonable approximation is the shadow offset plus the shadow spread. Either way, your not going to be able to use the image's original size as the final size because you are explicitly asking to draw outside of that original image.
> --
> David Duncan
> Apple DTS Animation and Printing
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden