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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 In 11.4.5 ImageEnMView does not update!

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
foxdingding Posted - Dec 05 2022 : 07:18:17
Hi xequte:

I find 11.4.5 ImageEnMView does not update!


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


11.4 is OK
8   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 07 2022 : 22:26:13
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
foxdingding Posted - Dec 07 2022 : 20:39:32
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;


xequte Posted - Dec 07 2022 : 14:04:44
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
foxdingding Posted - Dec 06 2022 : 04:07:28
64Bit EXE

attach/foxdingding/20221264818_Test.zip
8073.66 KB
foxdingding Posted - Dec 06 2022 : 03:51:04

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
xequte Posted - Dec 05 2022 : 21:45:47
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
foxdingding Posted - Dec 05 2022 : 20:26:40



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
xequte Posted - Dec 05 2022 : 14:05:59
Hi

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

Nigel
Xequte Software
www.imageen.com