ios - How can I convert my transparent PNG image to a Hexadecimal string? -


within sdk i'm using within 1 of apps there images. these images not listed image files hexedecimal encoded strings like:

unsigned char mastclosebutton_png[] = {   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,   0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x38,   0x08, 0x06, 0x00, 0x00, 0x00, 0xa8, 0x86, 0x3b, 0x1e, 0x00, 0x00, 0x00,   0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x2e, 0x23, 0x00, 0x00, 0x2e,   0x23, 0x01, 0x78, 0xa5, 0x3f, 0x76, 0x00, 0x00, 0x0a, 0x4d, 0x69, 0x43, }; 

no i'd adjust image within sdk unfortunately don't know how convert .png file hexadecimal string listed above.

are there tools convert .png image (with transparency) hexadecimal string?

try following code, might helpful you:

nsdata *imagedata = [[nsdata alloc]initwithdata:uiimagepngrepresentation(myimage.image)]; nsstring *imagestr = [gtmbase64 stringbyencodingdata:imagedata]; 

or follow:

http://kelp.phate.org/2012/05/high-performance-hex-encode-in.html


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -