Re: iPad app sending image to photo library does not capture background
Re: iPad app sending image to photo library does not capture background
- Subject: Re: iPad app sending image to photo library does not capture background
- From: David Duncan <email@hidden>
- Date: Fri, 30 Mar 2012 12:01:07 -0700
On Mar 30, 2012, at 11:33 AM, David Delmonte wrote:
> (I'm not sure if this question belongs in the xCode or the Cocoa list - Please forgive/enlighten me if I've chosen incorrectly).
If it has to do with code, its the Cocoa list. If it has to do with the developer tools themselves, its this one.
> I have an app that allows screen writing on a variety of background colors.
>
> When I invoke the method to capture the writing to the photo library, I get the writing but without any background color.
>
> I could use some help to figure out why..
>
> I draw the background color simply enough with:
>
> drawImage.backgroundColor = [UIColor someColor];
>
> drawImage is defined as a UIImageView.
First, don't do this. Its fine to display something via a view, and even to set properties onto that view to display them, but a view should never be the object of record for data. Have something else store the UIImage and UIColor that you are using, then use those properties appropriately to do what you need to do.
This is critically important because in various cases your application will see its views discarded (such as going into the background) and recreated, and if you don't have this information saved somewhere else then it will be lost forever.
All you need to do to add a background color to an image is to fill the target context with that color. You can do this by setting the color as the fill color, then using UIRectFill.
--
David Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden