unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, pngimage, PngImageProcessor, Math, IGDIPlus,
JaContainers;
type
TMyCalThread = class(TThread)
public
IsWorking: Boolean;
FDestBmp: TPNGObject;
protected
procedure Execute; override;
end;
TForm1 = class(TForm)
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Timer1: TTimer;
Button1: TButton;
procedure FormPaint(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
public
FCalThread: TMyCalThread;
end;
var
Form1: TForm1;
GSyn: TSyncObject;
implementation
{$R *.dfm}
{ TMyCalThread }
procedure TMyCalThread.Execute;
var
LSrcBmp: TPNGObject;
LTmpBmp: TPNGObjec
多线程处理图片,bmp不支持,png支持
最新推荐文章于 2023-04-11 21:46:45 发布
该博客讲述了在多线程环境下处理图片时遇到的问题,指出BMP格式由于依赖窗口处理而不适用于多线程场景,而PNG格式可以成功处理。示例代码展示了如何在Delphi中使用TThread处理PNG图片,并实现图片尺寸的随机调整。
摘要由CSDN通过智能技术生成