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
 Copy ImageEnVect Selected Object to ImageEnView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

sparkz

United Kingdom
8 Posts

Posted - Mar 06 2016 :  16:28:52  Show Profile  Reply
Hi

Sorry, this is a pretty basic question but I can't figure it out and can't find an example of it.

How do I update an ImageEnView component with a selected object from ImageEnVect?

Basically, when I select a bitmap object I want to show a copy of the image elsewhere.

Thanks
Mark

w2m

USA
1990 Posts

Posted - Mar 06 2016 :  18:17:47  Show Profile  Reply
procedure TForm1.ImageEnVect1ImageChange(Sender: TObject);
{OnImageChange occurs after the image is modified using TImageEnProc (Proc property) or TImageEnIO (IO property).}
begin
  { Update the background image }
  ImageEnView2.IEBitmap.Assign(ImageEnVect1.IEBitmap);
  ImageEnView2.Update;
end;

procedure TForm1.ImageEnVect1VectorialChanged(Sender: TObject);
{OnVectorialChanged occurs whenever an object is added, removed, moved, resized or modified by a user's action.}
begin
  { Update the background image }
  ImageEnView2.IEBitmap.Assign(ImageEnVect1.IEBitmap);
  ImageEnView2.Update;
  { Show the objects in ImageEnView2 }
  ImageEnVect1.DrawObjectsToBitmap(ImageEnView2.IEBitmap);
  ImageEnView2.Update;
end;

If you only want to show the objects when selected then eliminate the code in the ImageEnVect1VectorialChanged event and add the code to the ImageEnVect1SelectObject event:
procedure TForm1.ImageEnVect1SelectObject(Sender: TObject);
{OnSelectObject event occurs whenever an object is selected or deselected.}
begin
  { Show the objects in ImageEnView2 }
  ImageEnVect1.DrawObjectsToBitmap(ImageEnView2.IEBitmap);
  ImageEnView2.Update;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

sparkz

United Kingdom
8 Posts

Posted - Mar 06 2016 :  19:18:00  Show Profile  Reply
Brilliant. Many thanks Bill
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: