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 images from one TImageEnMView to another
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Milo

Slovenia
2 Posts

Posted - Jun 17 2014 :  06:40:40  Show Profile  Reply
Hi all !

I am trying to implement multiple document scanning that is based on EAN code recognition. I have implemented basic logic, but now I am stuck trying to copy images from one multiview (TImageEnMView) to another. Basicly, program will split image into files.

How can I copy image from ImageEnMView1 to ImageEnMView2 ?

... some code for better understanding:

for idx := 0 to ImageEnMView1.ImageCount - 1 do
begin
if (condition) then
// copy ImageEnMView1 image to ImageEnMView2
end;

w2m

USA
1990 Posts

Posted - Jun 17 2014 :  10:48:59  Show Profile  Reply
procedure TForm1.CopySelected1Click(Sender: TObject);
{ Copy the selected image in ImageEnMView1 to ImageEnMView2. }
var
  i: Integer;
  iIndex: integer;
begin
  for i := 0 to ImageEnMView1.ImageCount - 1 do
  begin
    if ImageEnMView1.SelectedImage = i then
    begin
      { Add an image to ImageEnMView2 }
      iIndex := ImageEnMView2.AppendImage;
      { Copy iebitmap from ImageEnMView1 to ImageEnMView2 }
      ImageEnMView2.SetIEBitmap(iIndex, ImageEnMView1.IEBitmap);
      { Set the bottom text of ImageEnMView2 }
      ImageEnMView2.ImageBottomText[iIndex].Caption := ImageEnMView1.ImageBottomText[i].Caption;
    end;
  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

Milo

Slovenia
2 Posts

Posted - Jun 19 2014 :  01:00:15  Show Profile  Reply
Thank you !

It works now, trick was in selecting image before copying it.

Regards Milo


for idx := 0 to ImageEnMView1.ImageCount - 1 do
begin
  // select image
  ImageEnMView1.SelectedImage := idx;
  // if condition
  if (LastCode <> ImageEnMView1.ImageBottomText[idx].Caption) then
  begin
    LastCode := ImageEnMView1.ImageBottomText[idx].Caption;
    // save & clear
  ImageEnMIO2.SaveToFilePDF(ImageEnMView1.ImageBottomText[idx].Caption);
    ImageEnMView2.Clear;
  end;	
  { Add an image to ImageEnMView2 }
  iIndex := ImageEnMView2.AppendImage;
  { Copy iebitmap from ImageEnMView1 to ImageEnMView2 }
  ImageEnMView2.SetIEBitmap(iIndex, ImageEnMView1.IEBitmap);
end;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: