#include "wx/wx.h"
int _tmain(int argc, _TCHAR* argv[])
{
wxInitialize();
wxImage imgSrc, imgDst;
imgSrc.LoadFile(wxT("test.bmp"));
// 灰度
imgDst = imgSrc.ConvertToGreyscale();
imgDst.SaveFile(wxT("test_greyscale.bmp"), wxBITMAP_TYPE_BMP);
// 缩放
imgDst = imgSrc.Scale(32, 32);
imgDst.SaveFile(wxT("test_scale(32,32).bmp"), wxBITMAP_TYPE_BMP);
// 旋转
imgDst = imgSrc.Rotate90();
imgDst.SaveFile(wxT("test_rotate90.bmp"), wxBITMAP_TYPE_BMP);
imgDst = imgSrc.Rotate(M_PI / 180 * 45, wxPoint(0, 0));
imgDst.SaveFile(wxT("test_rotate_45(0,0).bmp"), wxBITMAP_TYPE_BMP);
// 剪切
imgDst = imgSrc.GetSubImage(wxRect(0, 0, 100, 100));
imgDst.SaveFile(wxT("test_subimage(0,0,100,100).bmp"), wxBITMAP_TYPE_BMP);
wxUninitialize();
return 0;
}