Hi,
in the ImageEN Version 13 I have problems using the TImageEnMView. Theese problems didn't occur in the Version 11. I don't know, if they where present in Version 12.
I made a simple project:
- Loading 3 fixed Images in the List
- Adding ImageBottomText and ImageTag to all of them
Expected result:
- Pic1 with the Pottom Text "Pic 0" and ImageTag = 0
- Pic2 with the Pottom Text "Pic 1" and ImageTag = 1
- Pic3 with the Pottom Text "Pic 2" and ImageTag = 2
Result in fact;
- Pic1 with the Pottom Text "Pic 2" and ImageTag = 2
- Pic2 no Pottom Text and no ImageTag
- Pic3 no Pottom Text and no ImageTag
Can you help me with this problem?
Sourcecode:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyiedefs, hyieutils, iexBitmaps,
iesettings, iemio, ieview, iemview;
type
TForm1 = class(TForm)
imgList: TImageEnMView;
procedure FormShow(Sender: TObject);
procedure imgListImageSelect(Sender: TObject; idx: Integer);
private
procedure LoadPictures;
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
LoadPictures;
end;
procedure TForm1.imgListImageSelect(Sender: TObject; idx: Integer);
begin
Caption := 'Select Picture ImageTag: ' + imgList.ImageTag[idx].ToString;
end;
procedure TForm1.LoadPictures;
var
NdxDokList: Integer;
FileNames: TStringList;
Ndx: Integer;
begin
imgList.Clear;
FileNames := TStringList.Create;
FileNames.Add(ExtractFilePath(ParamStr(0)) + 'Pic1.png');
FileNames.Add(ExtractFilePath(ParamStr(0)) + 'Pic2.png');
FileNames.Add(ExtractFilePath(ParamStr(0)) + 'Pic3.png');
imgList.LockPaint;
imglist.Deselect;
for Ndx := 0 to FileNames.Count -1 do
begin
if ( imglist.MIO.LoadFromFileAuto(FileNames[Ndx]) ) then
begin
imglist.ImageBottomText[imglist.ImageCount - 1] := 'Pic ' + Ndx.ToString;
imglist.ImageTag[imglist.ImageCount - 1] := Ndx;
end;
end;
imgList.UnlockPaint;
FileNames.Free;
end;
end.