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
 Fast Repaint

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
wesleybobato Posted - Feb 17 2015 : 09:09:12
Hello Nigel.
Graphics32 has a property to Repaint Bitmap optimized and the result is very fast.

You can add a Method to Improve the Speed Repainting?

ImageEnView1.UpdateReason: = ieurChangeBitmap is possible?

I I have attached a Sample Image and Code.

Thank you for your attention.


unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ieview, imageenview, imageenio;

type
 TLoadPicture = class(TThread)
  _List: array [0..10] of string;
  _IE: TImageEnView;

  protected
   procedure Execute; override;

  public
   constructor Create(IE: TImageEnView);

 end;

type
  TForm2 = class(TForm)
    ImageEnView1: TImageEnView;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
   FLoadPicture: TLoadPicture;
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
 if Assigned(FLoadPicture) then
  begin
   if not FLoadPicture.Terminated then
    FLoadPicture.Terminate;

   FLoadPicture := nil;
  end;

 FLoadPicture := TLoadPicture.Create(ImageEnView1);
 FLoadPicture.Start;
end;

{ TLoadPicture }

constructor TLoadPicture.Create(IE: TImageEnView);
begin
 inherited Create(True);
 FreeOnTerminate := True;
 _IE             := IE;

 _List[0]  := 'C:\img\0.jpg';
 _List[1]  := 'C:\img\1.jpg';
 _List[2]  := 'C:\img\2.jpg';
 _List[3]  := 'C:\img\3.jpg';
 _List[4]  := 'C:\img\4.jpg';
 _List[5]  := 'C:\img\5.jpg';
 _List[6]  := 'C:\img\6.jpg';
 _List[7]  := 'C:\img\7.jpg';
 _List  := 'C:\img\8.jpg';
 _List[9]  := 'C:\img\9.jpg';
 _List[10] := 'C:\img\10.jpg';
end;

procedure TLoadPicture.Execute;
var
 _BMP: TImageEnIO;
  I: Integer;
begin
 if not Terminated then
  begin
   _BMP := TImageEnIO.Create(nil);
   try
    for I := Low(_List) to High(_List) do
     begin
      if Terminated then
       Break;

       begin
        _BMP.LoadFromFile(_List[I]);

        Synchronize(procedure ()
        begin
         _IE.IEBitmap.Assign(_BMP.IEBitmap);
         //_IE.UpdateReason := ieurChangeBitmap; Add This Option Please Nigel for Update Repaint Fast...
         _IE.Update; // Slow Because Process Very Information...
         Sleep(1000);
        end);

      end;
     end;

   finally
    FreeAndNil(_BMP);
   end;
  end;

 Terminate;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
 FLoadPicture := nil;
end;

end.

1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Feb 17 2015 : 19:33:42
Hi Wesley

When the entire bitmap has been replaced, there is not much of the Update function that could be skipped, so I don't see there would be much speed improvement.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com