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
 Image copy/assign: Timage to Imageenview
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AdrianKnowles

USA
35 Posts

Posted - Jun 03 2013 :  14:06:36  Show Profile  Reply
Hi,
apologies for such a trivial question but I just cant figure it out.

I'd like to
1) Copy a .jpg from a TImage into Imageenview and vice versa.

Between Timage's then I can just use
Image2.canvas.draw(0,0,Image1.picture.graphic) but for the life of me I cant figure out how to do it with Imageenview component :-)

Kind regards,
Adrian

w2m

USA
1990 Posts

Posted - Jun 03 2013 :  14:33:09  Show Profile  Reply
procedure TForm1.Button1Click(Sender: TObject);
{ Copy Bitmap from Image1 to ImageEnView. }
begin
  ImageEnView1.Bitmap.Assign(Image1.Picture.Bitmap);
  ImageEnView1.Update;
end;

procedure TForm1.Button2Click(Sender: TObject);
{ Copy Bitmap from ImageEnView to Image1. }
begin
  Image1.Picture.Bitmap.Assign(ImageEnView1.Bitmap);
  Image1.Update;
end;

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

AdrianKnowles

USA
35 Posts

Posted - Jun 03 2013 :  14:50:16  Show Profile  Reply
Many thanks for your help William!
I just tweaked it slightly as I was dealing with jpg images
ImageEnView1.Bitmap.Assign(Image1.Picture.graphic);

Kind regards,
Adrian

PS
I just ordered the book about 20 minutes ago :-)
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 03 2013 :  15:11:17  Show Profile  Reply
Thanks.

ImageEnView1.Bitmap.Assign(Image1.Picture.Bitmap); also works for jpeg in my testing... It did not work for you?

but I also used:
ImageEnIO1.AttachedTImage := Image1;
if OpenPictureDialog1.Execute then
 ImageEnIO1.LoadFromFile(OpenPictureDialog1.FileName);

William Miller
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: