delphi – 如何清除jpeg图像?

如何清除TJPEG Image图像?

JPG.Width:= 0技巧不起作用.
另外,我不想创建一个空位图(0x0像素)并将其分配给jpeg.

解决方法

你可以使用这样的东西(这里使用插入的类来访问受保护的方法):
type
  TJPEGImage = class(jpeg.TJPEGImage);

implementation

procedure TForm1.Button1Click(Sender: TObject);
var
  JPEGImage: TJPEGImage;
begin
  JPEGImage := TJPEGImage.Create;
  try
    // this should recreate the internal bitmap
    JPEGImage.NewBitmap;
    // this should recreate the internal image stream
    JPEGImage.NewImage;
    // here the memory used by the image should be released
  finally
    JPEGImage.Free;
  end;
end;

相关文章

 从网上看到《Delphi API HOOK完全说明》这篇文章,基本上都...
  从网上看到《Delphi API HOOK完全说明》这篇文章,基本上...
ffmpeg 是一套强大的开源的多媒体库 一般都是用 c/c+&#x...
32位CPU所含有的寄存器有:4个数据寄存器(EAX、EBX、ECX和ED...
1 mov dst, src dst是目的操作数,src是源操作数,指令实现的...