开发者

Opening And Saving Graphics Files In C++

开发者 https://www.devze.com 2023-02-20 21:54 出处:网络
I am developing a paint application in C++. The problem that I am facing is that I need to add the option to save and open a graphics file but I have no idea about bitmap images. Is there any other wa

I am developing a paint application in C++. The problem that I am facing is that I need to add the option to save and open a graphics file but I have no idea about bitmap images. Is there any other way without creating bitmap images to open and save the graphics f开发者_如何学Pythonile in C++?I am using graphics.h header file. Its old Turbo-C++ and Windows OS.

Thank-you.


You may have a look at FreeImage or OpenImageIO that do handle multiple bitmap image formats.

Maybe it's not what you're after, as I don't understand what you mean by "without creating bitmap images" ?


You can just use libpng to add support for reading and writing PNG files - it's a cross-platform library and it's free.

You should probably consider ditching Turbo C++ - it's old, doesn't conform to current C++ standards, and is unsupported. Use something a little more up-to-date, like gcc or Visual Studio (Express).


<graphics.h> is a deprecated header, and has been for fifteen years. You will want to use Direct2D, it is designed for the loading and manipulation of 2D images.


I can recommend the CXImage library. It is portable (tested on windows/linux), open source and handles a lot of file formats. Check out those links:

CXImage Homepage

CXImage on codeproject


Take a look into ImageMagick, or it's open source alternative GraphicsMagick.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号