首页 > 代码库 > cxImageUser
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。