cxImageUser
Posted 秋月的私语
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cxImageUser相关的知识,希望对你有一定的参考价值。
#pragma once #include "include/ximage.h" #ifdef _DEBUG #pragma comment(lib, "lib/cximaged_x64.lib") #pragma comment(lib, "lib/jasperd_x64.lib") //#pragma comment(lib, "lib/jbigd_x64.lib") #pragma comment(lib, "lib/Jpegd_x64.lib") #pragma comment(lib, "lib/libdcrd_x64.lib") #pragma comment(lib, "lib/mngd_x64.lib") #pragma comment(lib, "lib/pngd_x64.lib") #pragma comment(lib, "lib/Tiffd_x64.lib") #pragma comment(lib, "lib/zlibd_x64.lib") #else #pragma comment(lib, "lib/cximage_x64.lib") #pragma comment(lib, "lib/jasper_x64.lib") //#pragma comment(lib, "lib/jbig_x64.lib") #pragma comment(lib, "lib/Jpeg_x64.lib") #pragma comment(lib, "lib/libdcr_x64.lib") #pragma comment(lib, "lib/mng_x64.lib") #pragma comment(lib, "lib/png_x64.lib") #pragma comment(lib, "lib/Tiff_x64.lib") #pragma comment(lib, "lib/zlib_x64.lib") #endif // _DEBUG class CxImageUser { public: CxImageUser(); ~CxImageUser(); int png2jpg(const CString& strSrcFile, const CString& strDstFile); };
#include "stdafx.h" #include "cxImageUserU.h" CxImageUser::CxImageUser() { } CxImageUser::~CxImageUser() { } int CxImageUser::png2jpg( const CString& strSrcFile, const CString& strDstFile ) { CxImage image; //png -> jpg image.Load(strSrcFile, CXIMAGE_FORMAT_PNG); if (image.IsValid()){ if(!image.IsGrayScale()) image.IncreaseBpp(24); image.SetJpegQuality(80); image.Save(strDstFile,CXIMAGE_FORMAT_JPG); } return 0; }
以上是关于cxImageUser的主要内容,如果未能解决你的问题,请参考以下文章