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
 Replace selected image from ImageEnMView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

monzeryazigi

Kuwait
3 Posts

Posted - Aug 22 2016 :  16:35:15  Show Profile  Reply
Hi
I have a ImageEnMView component, where 5 frames are created from Video stream.

I need to replace one of the frames with another frame of the video.

How to do that?

Thanks

Monzer Yazigi

xequte

38613 Posts

Posted - Aug 22 2016 :  23:50:51  Show Profile  Reply
Hi Monzer

You could just delete the existing frame, and insert a new one.

Or you could replace the bitmap of an existing frame, e.g.

ImageEnMView1.SetImage( 5, MyNewBitmap );

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

monzeryazigi

Kuwait
3 Posts

Posted - Aug 23 2016 :  01:33:48  Show Profile  Reply
Hi Nigel,
I tried both ways, its not working. I tried:
Way 1
------
ImageEnMView1.DeleteImage(imgindex);
ImageEnMView1.InsertImage(imgindex, ImageEnView1.IEBitmap);

Way 2
------
ImageEnMView1.SetImage( imgindex, ImageEnView1.IEBitmap);

Both didnt work. Simply ImageEnMView does not replace the image.

Please advise

Monzer Yazigi
Go to Top of Page

w2m

USA
1990 Posts

Posted - Aug 23 2016 :  11:34:48  Show Profile  Reply
Is imgindex the ImageEnMView.SelectedImage?
Did you call ImageEnMView.Update after replacing the image. If you did not call update then the new bitmap may not be shown.

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

monzeryazigi

Kuwait
3 Posts

Posted - Aug 23 2016 :  16:03:49  Show Profile  Reply
Hi Bill,
Thanks for responding.
Yes, imgindex is the SelectedImage to be replaced.
I tried update, I tried refresh but nothing works.

Monzer Yazigi
Go to Top of Page

xequte

38613 Posts

Posted - Aug 23 2016 :  19:47:29  Show Profile  Reply
Hi Monzer

There must be something else going on. Just for sanity I ran the MultiView2 demo and loaded a multipage TIFF.

All of the following worked:

procedure TMainForm.Button1Click(Sender: TObject);
Begin
  ImageEnVect1.IO.LoadFromFile( 'D:\_Testfiles\ds1.jpg' );
  ImageEnMView1.SetImage( 1, ImageEnVect1.IEBitmap );
End;

procedure TMainForm.Button1Click(Sender: TObject);
Var
  bmp: TIEBitmap;
Begin
  bmp := TIEBitmap.Create;
  bmp.read( 'D:\_Testfiles\ds1.jpg' );
  ImageEnMView1.DeleteImage( 1 );
  ImageEnMView1.InsertImage( 1, bmp );
  bmp.free;
End;

procedure TMainForm.Button1Click(Sender: TObject);
Var
  bmp: TIEBitmap;
Begin
  bmp := TIEBitmap.Create;
  bmp.read( 'D:\_Testfiles\ds1.jpg' );
  ImageEnMView1.SetImage( 1, bmp );
  bmp.free;
End;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: