#include <jpeg.hpp>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Graphics::TBitmap *bm1 = new Graphics::TBitmap;
TPicture *Picture = new TPicture();
Picture->RegisterFileFormat(__classid(TJPEGImage), "jpg",
Picture->"jpg",__classid(TJPEGImage));
TJPEGImage *jp = new TJPEGImage();
try
{
Picture->LoadFromFile(szName);
bm1->Width = Picture->Graphic->Width;
bm1->Height = Picture->Graphic->Height;
bm1->Canvas->Draw(0,0,Picture->Graphic);
jp->Assign(bm1);
jp->SaveToFile(szName2);
}
__finally
{
delete jp;
delete bm1;
delete Picture;
}
}
Michael Yaroslavl 2:5028/52.229 Konstantin Muschinin 2:5028/52.230
Предыдущий вопрос
|
|
Следующий вопрос
источник
by jenyok
|