I am trying to make a DLL that generates images out of other images. The DLL has to be small, because the whole point of the DLL is to make my program smaller (because that way I don't have to add the images). I am storing the image data in an array:
1 2 3 4 5 6 7
struct pixel {
char r,g,b,a;
};
pixel pixels[100][100];
// to get the red color value of a pixel:
pixel[y][x].r
I tried using libpng to save the image, but apparenty it requires zlib. I tried including the zlib source, but it doesn't compile (I am using Dev-C++). I keep getting 'redeclared as different kind of symbol' errors. Isn't there a simpler way to do this?
zlib includes some example files... none of which you are supposed to include in your source (they're just example of how to use the library). I think they're "example.c" and "minigzip.c". Try removing those from your program and see if it clears up your errors.
Unless you find some other kind of image library -- it isn't really any easier. libpng's interface is incredibly ugly, too.
I managed to compile my code now, but apparently libpng uses 250bk! Isn't there some windows DLL like winAPI to save and load images (my program will only be used on windows)?