Re: Embedding image data
Re: Embedding image data
- Subject: Re: Embedding image data
- From: August Trometer <email@hidden>
- Date: Mon, 13 Mar 2006 01:11:19 -0500
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
On Mar 13, 2006, at 12:02 AM, Scott Thompson wrote:
On Mar 12, 2006, at 12:54 PM, August Trometer wrote:
I've got a custom view class that uses a particular background
image. This image is static and won't change, even when used in
multiple applications. I'd like to make the class more portable,
and I don't want to have to copy the background image as well as
the source files. So, what I want to do is embed the image data in
the source file itself.
I'm guessing that I should do this as a static NSData object, then
use that data to create the image. However, I'm having trouble
figuring out the best way to represent the image data as well as
the coding the NSData object itself. Is there a good way to do this?
Sounds like an unusual thing to want to do. Even if you embed the
data directly into your source code, you're still going to be
making copies of the image every time you include that code in an
application. Why not just leave the image in the Resources fork
of your bundle and pull it from there?
Scott
_______________________________________________
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