将Png转为Jpg的问题,求解?
下面的代码得到的JPG是0字节的,没有成功,各位大侠帮忙一下!
jpeg、png的头文件都加了
#include <jpeg.hpp> #include <pngimage.hpp> ............. TPNGObject *PngPic=new TPNGObject(); PngPic->LoadFromFile("abc.png"); Graphics::TBitmap *bitmap=new Graphics::TBitmap; bitmap->Canvas->CopyRect(TRect(0,0,1000,1000),PngPic->Canvas,TRect(0,0,1000,1000)); JpgPic->Assign(bitmap); JpgPic->SaveToFile("temp.jpg"); //0字节