码迷,mamicode.com
首页 > 其他好文 > 详细

cxImageUser

时间:2017-06-22 17:05:07      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:return   bug   ring   user   .lib   nbsp   color   jpeg   string   

#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

标签:return   bug   ring   user   .lib   nbsp   color   jpeg   string   

原文地址:http://www.cnblogs.com/autumoonchina/p/7065290.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!