📄 demoform.pas
字号:
unit demoform;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, FileCtrl;
type
TForm1 = class(TForm)
Button1: TButton;
FileListBox1: TFileListBox;
DirectoryListBox1: TDirectoryListBox;
DriveComboBox1: TDriveComboBox;
FilterComboBox1: TFilterComboBox;
ScrollBox1: TScrollBox;
Image1: TImage;
SaveDialog1: TSaveDialog;
procedure FileListBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function WyLoadImage(FileName: PChar): HBitmap; stdcall;
external 'JpegLib';
function WySaveJpg(FileName: PChar;Quality:integer;Gray: Boolean):boolean; stdcall;
external 'JpegLib';
implementation
{$R *.DFM}
procedure TForm1.FileListBox1Click(Sender: TObject);
var
s: string;
begin
s := FileListBox1.FileName;
{ if UpperCase(ExtractFileExt(s))='.JPG' then
Image1.Picture.Bitmap.Handle := WyLoadJpg(PChar(s), False);
if UpperCase(ExtractFileExt(s))='.GIF' then
begin
Image1.Picture.Bitmap.Handle:=WyLoadGIF(PChar(s));
form1.Caption:=inttostr(WyReadAniGIFInfo(PChar(s)));
end;}
Image1.Picture.Bitmap.Handle := WyLoadImage(PChar(s));
image1.AutoSize:=true;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if SaveDialog1.Execute then
WySaveJpg(PChar(savedialog1.FileName),70, True);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -