ImageEn Forum
ImageEn Forum
Profile | Join | Active Topics | Search | Forum FAQ
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 Support and Discussion Forum
 Dual output
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

egrobler

42 Posts

Posted - Apr 26 2012 :  16:43:06  Show Profile  Reply
Hello,

I have a program where a teacher draws annotations on an image (TImageEnVect) for students in a class.
The program runs on a dual screen.
Is it possible to paint the contents of the image twice, to the normal canvas and to a larger canvas on the second monitor/projector in real time?

Best Regards
Eric

fab

1310 Posts

Posted - Apr 29 2012 :  00:49:34  Show Profile  Reply
Hello,
you should use SetExternalBitmap method. For example, having ImageEnView1 on a monitor and ImageEnView2 on another monitor, you could write:

ImageEnView2.SetExternalBitmap( ImageEnView1.IEBitmap );

Look at Display\ExternalBitmap for a sample.

Another way could be to handle OnDrawBackBuffer event and replicate the content of first ImageEnView to another one.
Go to Top of Page

egrobler

42 Posts

Posted - Apr 29 2012 :  06:30:41  Show Profile  Reply
Thank you, that is what I was looking for.

Is there also a way to play a video on 2 screens simultaneously?
Go to Top of Page

egrobler

42 Posts

Posted - Apr 29 2012 :  08:06:15  Show Profile  Reply
Hi Fabrizio,

The ExternalBitmap demo sets the SetExternalBitmap back to nil when the form is closed, but how can I set ImageEnVect1 back to the original state, so that I can load a new image independently?

It seems like I need to call Clear and ResetState additionally.
Is this the correct way?
Example:

  ImageEnVect1.SetExternalBitmap(ImageEnVect2.IEBitmap);
  ImageEnVect1.IO.loadfromfile('pic1.jpg');
  ImageEnVect2.Update;

  ShowMessage('Press to detach');
  ImageEnVect1.SetExternalBitmap(nil);  
  ImageEnVect1.ResetState;
  ImageEnVect1.Clear;
  ImageEnVect1.IO.loadfromfile('pic2.jpg');
Go to Top of Page

fab

1310 Posts

Posted - May 02 2012 :  07:39:36  Show Profile  Reply
Hello,
why do you need to set ImageEnVect1 back to the original state?
Assume this:
1) ImageEnVect1 is the main viewer (where actually images are loaded)
2) ImageEnVect2 is the external viewer

You should set:

ImageEnVect2.SetExternalBitmap( ImageEnVect1 );

Now you should work only on ImageEnVect1 and update ImageEnVect2. For example, if a new image needs to be loaded just execute:

ImageEnVect1.IO.LoadFromFile(...); // load in ImageEnVect1
ImageEnVect2.Update(); // refresh ImageEnVect2 display

You should refresh ImageEnVect2 also whenever ImageEnVect1 changes:

ImageEnVect1.Proc.Negative(); // makes image in ImageEnVect1 negative
ImageEnVect2.Update(); // refresh ImageEnVect2 display

You should call SetExternalBitmap(nil) only at the end of your application, or if you want to make ImageEnVect2 stand-alone.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: