Re: Embedding image data
Re: Embedding image data
- Subject: Re: Embedding image data
- From: glenn andreas <email@hidden>
- Date: Mon, 13 Mar 2006 10:13:08 -0600
On Mar 13, 2006, at 10:00 AM, Eric Long wrote:
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.
Actually, for a static array you can just do something like this:
const char myArray[] = 0xFF, etc.
length = sizeof(myArray)
This will not work for a dynamically allocated array, since you'd
just get
the size of the ptr.
I'd sure hate to have to work on a source file that was a half meg
large, just because a 100K image was "embedded" (where every byte
becomes 5 characters). Even disregarding the extra stress it puts on
an editor, just imagine trying to scroll through the source code
using the scrollbar when only the 1% of the area of the scrollbar
actually covers the source code (and all the rest is the embedded
image).
This is just the sort of thing a custom private framework would work
well for...
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
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