现在的位置: 首页 > 综合 > 正文

将图片转存为其它颜色格式(GDI+)

2011年08月27日 ⁄ 综合 ⁄ 共 331字 ⁄ 字号 评论关闭
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;

【上篇】
【下篇】

抱歉!评论已关闭.