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
 GetItemThumbnail
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

abif

Brazil
4 Posts

Posted - Apr 05 2012 :  18:10:10  Show Profile  Reply
Using the MIO.SelectAcquireSource, at "Get Pictures from..." dialog:

How can I get the thumbnails without using a TreeNode? I mean, after I click the thumbnail(s), and then click on the "Get Pictures button"?

For example:
ImageEnView1.IO.WiaParams.GetItemThumbnail( TIEWiaItem(Node.Data), ImageEnView2.IEBitmap );
ImageEnView2.Update;

Is there a way to fill an ImageEnMView1 with all photos off the camera?

Thank you!


fab

1310 Posts

Posted - Apr 06 2012 :  00:19:18  Show Profile  Reply
Hello,
to fill a TImageEnMView with WIA content you have to loop among all children of WIAParams.Device (that is the root). Example:

var
  i, iidx: integer;
begin
  // prompt user to select a device
  ImageEnMView1.MIO.SelectAcquireSource([ieaWIA]);

  // loop among children of Device (the root item)
  for i:=0 to ImageEnMView1.MIO.WIAParams.Device.Children.Count-1 do
    // process only images
    if witImage in TIEWiaItem(ImageEnMView1.MIO.WIAParams.Device.Children[i]).ItemType then
      with ImageEnMView1.MIO.WIAParams, Device do
      begin
        // add new empty image
        iidx := ImageEnMView1.AppendImage(1, 1);  
        // get thumbnail and store in TImageEnMView bitmap
        GetItemThumbnail(Children[i], ImageEnMView1.GetTIEBitmap(iidx));  
        // close GetTIEBitmap()
        ImageEnMView1.ReleaseBitmap(iidx);  
        // just to associate TImageEnMView item with WIA item
        ImageEnMView1.ImageUserPointer[iidx] := Children[i];  
      end;
end;


Now you can load the full image into a TImageEnView when user select a thumbnail (handling OnImageSelect of TImageEnMView), retrieving the item stored in ImageUserPointer[] property:

procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin
  ImageEnView1.IO.WIAParams.ProcessingBitmap := ImageEnView1.IEBitmap;
  ImageEnView1.IO.WIAParams.Transfer( ImageEnMView1.ImageUserPointer[idx] , false);
  ImageEnView1.Update;
end;


Hope this helps.
Go to Top of Page

abif

Brazil
4 Posts

Posted - Apr 06 2012 :  10:16:58  Show Profile  Reply
Yes it helped a lot Fabrizio, many thanks!

And if ImageEnMView1.MIO.AcquireParams.SelectedSource.Api = ieaDCIM, there is a way to fill the ImageEnMView1 likewise?
Go to Top of Page

xequte

39076 Posts

Posted - Apr 06 2012 :  17:05:01  Show Profile  Reply
Hi

With the DCIM source it will simply assign all images found in the DCIM source to the TImageEnMView.



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: