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
 Where is CopyToIEBitmap ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Mar 17 2016 :  03:18:32  Show Profile  Reply
I have turned LegacyBitmap to False but my TImageEnView only uses CopyToBitmap which is a TBitmap destination. How do I pass IEBitmap of my TImageEnView to another, like a TIEBitmap?

Thanks in advance.

Andy

w2m

USA
1990 Posts

Posted - Mar 17 2016 :  08:36:46  Show Profile  Reply
There are a number of ways to copy a TIEBitmap including:
ImageEnView2.Assign(ImageEnView1); // Copy content including Bitmap and IEBitmap from another TImageEnView, including layers and IO params
ImageEnView2.IEBitmap.Assign(ImageEnView1.IEBitmap);  // Copy only IEBitmap, does not copy layers and IO params
ImageEnView2.Assign(ImageEnView1.IEBitmap); // Copy only the ieBitmap of another TImageEnView does not copy layers and IO params

There are other ways to copy a TIEBitmap to another not listed including use of a TMemoryStream. The best way to copy depends are what your needs are.

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

AndyColmes

USA
351 Posts

Posted - Mar 17 2016 :  09:53:02  Show Profile  Reply
Hi Bill, thank you for the response. My goal is to be able to create a TIEBitmap and have a TImageEnView copy the ieBitmap to it. How would I do that without CopyToBitmap?

Andy
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 17 2016 :  10:44:17  Show Profile  Reply
Just create a TIEBitmap and assign it to TImageEnView.IEBitmap:
procedure TForm1.Button1Click(Sender: TObject);
var
  iIEBitmap: TIEBitmap;
begin
  try
    iIEBitmap := TIEBitmap.Create;
    iIEBitmap.Width := 640;
    iIEBitmap.Height := 480;
    iIEBitmap.PixelFormat := ie24RGB;
    iIEBitmap.Fill(clWhite);
    ImageEnView1.IEBitmap.Assign(iIEBitmap);
    ImageEnView1.IO.Params.Width := iIEBitmap.Width;
    ImageEnView1.IO.Params.Height := iIEBitmap.Height;
    ImageEnView1.IO.Params.BitsPerSample := 8;
    ImageEnView1.IO.Params.SamplesPerPixel := 3;
    ImageEnView1.Update;
  finally
    iIEBitmap.Free;
  end;
 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

AndyColmes

USA
351 Posts

Posted - Mar 17 2016 :  11:46:29  Show Profile  Reply
Hi Bill, thank you very much for the tip. I will give that a try.

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