Re: Embedding image data
Re: Embedding image data
- Subject: Re: Embedding image data
- From: Scott Thompson <email@hidden>
- Date: Mon, 13 Mar 2006 08:20:14 -0600
On Mar 13, 2006, at 12:11 AM, August Trometer wrote:
Thanks for the reply!
Well, the idea is this:
I have a control with a background image. This control will be used
across multiple apps (and perhaps multiple coders). What I'm trying
to do is embed the image data so that I don't have to include the
image file along with the source code. That way all I have to do is
copy the source files into the app and it's ready to go. 2 files to
copy instead of 3. This way, it's also easier to share with other
authors as well.
Perhaps I'm just trying to overcomplicate things, but it just seems
(to me) that it would be handy. Plus, it would also help prevent
others from grabbing the image out of the Resources file (not that
this is a primary concern, but it's certainly a side benefit).
Thanks!
August
At the same time, it makes your control harder to change... you can't
just edit the external file to change the appearance of the control.
On the whole I would recommend against this idea.
If you are determined, however, you could do something like use
hexdump to dump the image data in hexadecimal form. Format the
hexadecimal so that you can include it in a char * array. Also write
the length of the data into a variable. Then, at runtime, you simply
build your CFData from the char * array and import the image from there.
Scott
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden