ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 In 11.4.5 ImageEnMView does not update!
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

foxdingding

77 Posts

Posted - Dec 05 2022 :  07:18:17  Show Profile  Reply
Hi xequte:

I find 11.4.5 ImageEnMView does not update!


ImageEnMView.ReloadImage(Idx);
ImageEnMView.UpdateImage(Idx);


11.4 is OK

xequte

38715 Posts

Posted - Dec 05 2022 :  14:05:59  Show Profile  Reply
Hi

What method did you use to modify the image at idx?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

foxdingding

77 Posts

Posted - Dec 05 2022 :  20:26:40  Show Profile  Reply



procedure TMAutoMainForm.Proc_DoFun2(HFunc: TFunc<TImageEnView, boolean>);
Var
  tmpImageEnView:TImageEnView;
  tmpFileName:String;
  Idx:Integer;

...............
...............
...............

  idx:=ImageEnMView.SelectedImage;
  if idx<0 then Exit;

  tmpFileName :=ImageEnMView.SelectedFilename;
  if tmpFileName.IsEmpty then Exit;

  tmpImageEnView:=TImageEnView.Create(Self);
  Try
    ImageEnMView.CopyToIEBitmap(idx,tmpImageEnView.IEBitmap,TRUE);

    if HFunc(tmpImageEnView) Then
    Begin
       tmpImageEnView.IO.SaveToFileIEN(tmpFileName);

       ImageEnMView.ReloadImage(Idx);
       ImageEnMView.UpdateImage(Idx);
    End;
  Finally
    tmpImageEnView.Free;
  End
Go to Top of Page

xequte

38715 Posts

Posted - Dec 05 2022 :  21:45:47  Show Profile  Reply
That code works fine for me (you don't need the UpdateImage() line either).

Does the image change in Windows Explorer?

Are you able to reproduce by adding that code to any of our demos?


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

foxdingding

77 Posts

Posted - Dec 06 2022 :  03:51:04  Show Profile  Reply

unit Unit20;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyiedefs, hyieutils, iexBitmaps,
  iesettings, iexLayers, iexRulers, iexToolbars, iexUserInteractions, imageenio,
  imageenproc, Vcl.Buttons, Vcl.ExtCtrls, ieview, imageenview, iemio, iemview;

type
  TForm20 = class(TForm)
    Panel1: TPanel;
    SPB_Load: TSpeedButton;
    ImageEnMView1: TImageEnMView;
    SPB_ReLoad: TSpeedButton;
    procedure SPB_LoadClick(Sender: TObject);
    procedure ImageEnMView1DblClick(Sender: TObject);
    procedure SPB_ReLoadClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form20: TForm20;

implementation

{$R *.dfm}

procedure TForm20.ImageEnMView1DblClick(Sender: TObject);
Var
  tmpImageEnView:TImageEnView;
  tmpFileName:String;
  Idx:Integer;
begin
  idx:=ImageEnMView1.SelectedImage;
  if idx<0 then Exit;

  tmpFileName :=ImageEnMView1.SelectedFilename;
  if tmpFileName.IsEmpty then Exit;

  tmpImageEnView:=TImageEnView.Create(Self);
  Try
    ImageEnMView1.CopyToIEBitmap(idx,tmpImageEnView.IEBitmap,TRUE);
    tmpImageEnView.Proc.Rotate(45);

    tmpImageEnView.IO.SaveToFileIEN(tmpFileName);

    ImageEnMView1.ReloadImage(Idx);
  Finally
    tmpImageEnView.Free;
  End;
end;

procedure TForm20.SPB_LoadClick(Sender: TObject);
begin
    Self.ImageEnMView1.AppendImage('..\..\OLD_00D82D24-63A1-482C-845D-F6A45E8B0C48.IEN');
end;

procedure TForm20.SPB_ReLoadClick(Sender: TObject);
begin
    Self.ImageEnMView1.AppendImage('..\..\OLD_00D82D24-63A1-482C-845D-F6A45E8B0C48.IEN');
end;

end.







attach/foxdingding/20221264324_TestBug2.zip
9977.59 KB
Go to Top of Page

foxdingding

77 Posts

Posted - Dec 06 2022 :  04:07:28  Show Profile  Reply
64Bit EXE

attach/foxdingding/20221264818_Test.zip
8073.66 KB
Go to Top of Page

xequte

38715 Posts

Posted - Dec 07 2022 :  14:04:44  Show Profile  Reply
Hi

ReloadImage() only works with images loaded on demand (i.e. ones it is confident that it's safe to reload).

Either load the image on demand:

Self.ImageEnMView1.AppendImage( 'D:\im.jpg', True, iedtNone, iedtNone, iedtNone, True );

Or manually reload the image:

http://www.imageen.com/help/TImageEnMView.SetImageFromFile.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

foxdingding

77 Posts

Posted - Dec 07 2022 :  20:39:32  Show Profile  Reply
11.4.5 Replace ReloadImage to SetImage is OK!
Why is it possible to use ReloadImage in 11.4?


  tmpImageEnView:=TImageEnView.Create(Self);
  Try
    ImageEnMView1.CopyToIEBitmap(idx,tmpImageEnView.IEBitmap,TRUE);
    tmpImageEnView.Proc.Rotate(45);

    ImageEnMView1.SetImage(idx,tmpImageEnView.IEBitmap);
    tmpImageEnView.IO.SaveToFileIEN(tmpFileName);

    //ImageEnMView1.ReloadImage(Idx);//11.4 is OK
  Finally
    tmpImageEnView.Free;
  End;


Go to Top of Page

xequte

38715 Posts

Posted - Dec 07 2022 :  22:26:13  Show Profile  Reply
Hi

In 11.4.0 and older ImageEn was was quite *loose* in what it considered an on-demand image (e.g. allowed an image not loaded on demand, but appeared to be available on the system). From v11.4.5 we strictly limit on-demand images to ones where the on-demand flag was set when loading.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: