随笔 - 2146  文章 - 97 评论 - 11758 trackbacks - 253


uses GdiPlus;

procedure TForm1.Button1Click(Sender: TObject);
var
  img: IGPImage;
  bit: IGPBitmap;
  g: IGPGraphics;
begin
  img := TGPImage.Create('c:\temp\01.png');
  bit := TGPBitmap.Create(img.Width, img.Height, PixelFormat1bppIndexed);
  g := TGPGraphics.Create(bit);
  g.DrawImage(img, 0, 0, img.Width, img.Height);
  bit.Save('c:\temp\02.png', TGPImageFormat.Png);
end;

posted on 2011-07-20 21:09 万一 阅读(...) 评论(...) 编辑 收藏