summaryrefslogtreecommitdiff
path: root/common/image.cpp
diff options
context:
space:
mode:
authorleo1999-12-08 00:37:13 +0000
committerleo1999-12-08 00:37:13 +0000
commit212f7e96ee4a5a6b87abb51e85c9a92febc0078b (patch)
tree5bb0554028190685b5f0087e4771410d092dc4ec /common/image.cpp
parentf5edc7c4976d67e5d1c6bf37cf1a6687d9f22f0e (diff)
Added support for saving PNG files
git-svn-id: http://svn.leocad.org/trunk@27 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/image.cpp')
-rw-r--r--common/image.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/image.cpp b/common/image.cpp
index 7c03c16..ae919cb 100644
--- a/common/image.cpp
+++ b/common/image.cpp
@@ -23,6 +23,7 @@ static LC_IMAGE* OpenGIF(File* file);
static bool SaveJPG(char* filename, LC_IMAGE* image, int quality, bool progressive);
static bool SaveBMP(char* filename, LC_IMAGE* image, bool quantize);
static bool SaveGIF(File* file, LC_IMAGE* image, bool transparent, bool interlaced, unsigned char* background);
+bool SavePNG(char* filename, LC_IMAGE* image, bool transparent, bool interlaced, unsigned char* background);
typedef struct bt_jpeg_error_mgr
{
@@ -208,6 +209,9 @@ bool SaveImage(char* filename, LC_IMAGE* image, LC_IMAGE_OPTS* opts)
if (strcmp (ext, "bmp") == 0)
return SaveBMP(filename, image, opts->truecolor == false);
+ if (strcmp (ext, "png") == 0)
+ return SavePNG(filename, image, opts->transparent, opts->interlaced, opts->background);
+
// MessageBox (NULL, "Could not save file", "Error", MB_ICONSTOP);
return false;