图像浏览器
提示:这里可以添加技术概要
核心源码
procedure TViewForm.FormKeyPress(Sender: TObject; var Key: Char);
var
path1: string;
newbmp: TBitmap;
begin
newbmp := TBitmap.Create;
if (Key = ‘+’) then
begin
with browse do
begin
if (Nampos < FileListBox1.Items.Count) then
begin
Nampos := Nampos + 1;
path1 := DirectoryListBox1.Directory + ‘’ +
FileListBox1.Items[NamPos - 1];
image1.Picture.LoadFromFile(path1);
newbmp.Assign(Image1.Picture.Graphic);
Image1.Picture.Bitmap.Assign(newbmp);
end;
end;
end;
if (key = ‘-’) then
begin
with browse do
begin
if (Nampos > 1) then
begin
Nampos := Nampos - 1;
path1 := DirectoryListBox1.Directory + ‘’ +
FileListBox1.Items[Nampos - 1];
image1.Picture.LoadFromFile(path1);
newbmp.Assign(Image1.Picture.Graphic);
Image1.Picture.Bitmap.Assign(newbmp);
end;
end;
end;
newbmp.Free;
end;
procedure TViewForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
browse.Show;
end;
unit browse1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, jpeg, FileCtrl, StdCtrls, Gauges, Buttons;
type
TBrowse = class(TForm)
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FilterComboBox1: TFilterComboBox;
Panel1: TPanel;<