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
 copy a TImageEnMView to another TImageEnMView

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
roberto Posted - Sep 22 2013 : 01:48:57
Can you please let me know the best way to copy a TImageEnMView to another TImageEnMView.

I did try the assign without success.
3   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Sep 22 2013 : 08:56:36
Here is the fastest way. Loading the file on demand (threaded)...
procedure TForm1.Copy1Click(Sender: TObject);
{ Copy the contents of ImageEnView1 to ImageEnView2 }
var
  i: Integer;
begin
  Screen.Cursor := crHourGlass;
  try
    ImageEnMView2.Clear;
    for i := 0 to ImageEnMView1.ImageCount - 1 do
    begin
      { Add an image to ImageEnMView2 on demand }
      ImageEnMView2.LoadFromFileOnDemand(ImageEnMView1.ImageFileName[i], true);
      { Set the filename of ImageEnMView2 }
      ImageEnMView2.ImageFileName[i] := ImageEnMView1.ImageFileName[i];
      { Set the MIO.Params of ImageEnMView2 }
      ImageEnMView2.MIO.Params[i].Assign(ImageEnMView1.MIO.Params[i]);
      { Set the ImageEnMView2 bottom text }
      ImageEnMView2.ImageBottomText[i].Caption := ImageEnMView1.ImageBottomText
      [i].Caption;
    end;
    { Scroll ImageEnMView2 to beginning }
    ImageEnMView2.DisplayImageAt(0, 0, 0);
  finally
    Screen.Cursor := crDefault;
   end;
end;
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
roberto Posted - Sep 22 2013 : 08:35:09
thank´s a lot!
w2m Posted - Sep 22 2013 : 07:41:05
Here is one way...
procedure TForm1.Copy1Click(Sender: TObject);
{ Copy the contents of ImageEnView1 to ImageEnView2 }
var
  i: integer;
begin
  ImageEnMView2.Clear;
  for i := 0 to ImageEnMView1.ImageCount-1 do
  begin
    { Add an image to ImageEnMView2}
    ImageEnMView2.AppendImage;
    { Set the filename of ImageEnMView2 }
    ImageEnMView2.ImageFileName[i] := ImageEnMView1.ImageFileName[i];
    { Set the ieBitmap of ImageEnMView2 }
    ImageEnMView2.SetIEBitmap(i, ImageEnMView1.GetTIEBitmap(i));
    { Release the bitmap to free memory }
    ImageEnMView2.ReleaseBitmap(i);
    { Copy the MIO.Parames to ImageEnMView2 }
    ImageEnMView2.MIO.Params[i].Assign(ImageEnMView1.MIO.Params[i]);
    { Set the ImageEnMView2 bottom text }
    ImageEnMView2.ImageBottomText[i].Caption := ImageEnMView1.ImageBottomText[i].Caption;
  end;
  { Scroll ImageEnMView2 to beginning }
  ImageEnMView2.DisplayImageAt(0, 0, 0);
end;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html