tags:

views:

182

answers:

2

Hi, all! I have an array of data that represents PNG:

unsigned short systemFontTexture[] = {

...
0x5089,0x474E,0x0A0D,0x5089,0x474E,0x0A0D,0x5089,
0x474E,0x0A0D,0x5089,0x474E,0x474E,0x0A0D,0x5089,
0x474E,0x0A0D,0x5089,0x474E,0x474E,0x0A0D,0x5089,
...

}

Can I create PNG file using this data? If yes, then HOW?

+2  A: 

create a graphics context for an image and draw onto it. then save to png

Create a CGBitmapContext

draw your pixels

create a create a CGImage from from the CGBitmapContext

save the CGImage as PNG using CGImageDestination

PeanutPower
+3  A: 

Create a data provider to serve up the data, and then create an image with the data provider.

Peter Hosey