how to convert image into binary using C++
-
well i want image of any extension to be converted into binary and save it into some file. then read it back to generate image can any one help me plz
-
well i want image of any extension to be converted into binary and save it into some file. then read it back to generate image can any one help me plz
Well, ANY extension (i assume you mean format by extension, since extension is just some characters after the name of the image, which basicly means nothing, i can rename my Whatever.bmp to Whatever.jpg, that won't actually make it a JPEG image...) is a bit broad, but you can use CxImage[^] to load many kinds of formats, then you can create a DIB section using CreateDIBSection[^] and then blit the image onto it. Since CreateDIBSection gives you a pointer at the pixel data, you can do with it whatever you like, like save it as it is. Doing this the other way should be quite straightforward too. Hope that helps. p.s: Could be that CxImage itself gives you a way to access the "raw" pixel data (or even save it as raw format), am not sure about that, but you can find that out yourself.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
well i want image of any extension to be converted into binary and save it into some file. then read it back to generate image can any one help me plz