ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 LoadFromFileOnDemand and ImagingAnnot

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
graph_man Posted - Jun 02 2015 : 07:51:39
I have ImageEnMView2 <---> ImageEnMIO2

If I use
ImageEnMIO2->LoadFromFileTIFF(TempFileTiff);
I can get
ImageEnMIO2->Params[0]->ImagingAnnot->ObjectsCount

result for my file and first page is 4

If I use
ImageEnMView2->LoadFromFileOnDemand(TempFileTiff, false);
I can't get
ImageEnMView2->MIO->Params[0]->ImagingAnnot->ObjectsCount

result is 0

How to fix it?
10   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 22 2015 : 21:46:07
Hi

In v6.1.0 you can use EnsureImageLoaded to force the loading of an image so its params are ready.

// Read the Photoshop description of the selected image
if ImageEnMView1.SelectedImage >= 0 then
begin
  ImageEnMView1.EnsureImageLoaded( ImageEnMView1.SelectedImage );
  StatusBar.Text [ 1 ] := ImageEnMView1.MIO.Params[ ImageEnMView1.SelectedImage ].ReadIPTCField(PhotoShop_IPTC_Records, IPTC_PS_Caption);
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jun 06 2015 : 08:38:09
I want to point out that TIEImageEnAnnot does not have ObjectsCount property currently. Here are the current properties for both:

TIEImagingAnnot
- Assign
- Clear
- CopyFromTImageEnVect
- CopyToTImageEnVect
- DrawToBitmap
- LoadFromStandardBuffer
- LoadFromStream
- Objects
- ObjectsCount
- SaveToStandardBuffer
- SaveToStream

TIEImageEnAnnot
- Clear
- CopyToTImageEnVect
- CopyFromTImageEnVect
- DrawToBitmap
- IsEmpty
- ObjectsCount - Not available in 6.1 but just added in repository.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Jun 04 2015 : 15:53:39
Hi

Thanks for the report. I'll investigate this shortly.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
graph_man Posted - Jun 03 2015 : 16:54:42
I have found other solution

TImageEnIO* MyIO = new TImageEnIO(this);

for (int i = 0; i < PagesCount; i++)
{
MyIO->Params->ImageIndex = i;
MyIO->ParamsFromFile(FileName);
ImageEnMIO2->Params[i]->Assign(MyIO->Params);
}

delete MyIO;

Now I have access to all parameters including ImagingAnnot
graph_man Posted - Jun 02 2015 : 15:30:20
No, I know exactly that these objects are ImagingAnnot objects
w2m Posted - Jun 02 2015 : 15:26:58
It is also possible that the objects you have created are not ImagingAnnot object and are ImageEnAnnot objects. They are different... Unfortunately there is no ImageEnAnnot.ObjectsCount parameter.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
graph_man Posted - Jun 02 2015 : 15:21:47
I will wait for Nigel answer
w2m Posted - Jun 02 2015 : 14:55:11
Not possible I am afraid unless the problem I demonstrated is fixed. Meanwhile... you could do it this way and not even see the TImageEnVect:
var
  iImageEnVect: TImageEnVect;
  iObjectCount: Integer;
begin
  { Display the object count in the statusbar. }
  iImageEnVect := TImageEnVect.Create(nil);
  try
    ImageEnMView1.MIO.Params[idx].ImageEnAnnot.CopyToTImageEnVect
      (iImageEnVect);
    iObjectCount := iImageEnVect.ObjectsCount;
    StatusBar1.Panels[5].Text := 'Objects: ' + IntToStr(iObjectCount);
  finally
    iImageEnVect.Free;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
graph_man Posted - Jun 02 2015 : 13:38:05
Thanks, but I need to display this value (ObjectsCount) on all thumbnails without loading each into ImageEnVect1.
w2m Posted - Jun 02 2015 : 10:32:01
As best as I can determine this may be a bug. My test application shows that the ImagingAnnot.ObjectsCount is indeed 0 despite the fact that the objects are visible in the thumbnail for the selected image and ImageEnAnnot.IsEmpty is not True and ImageEnAnnot.CopyToTImageEnVect successfully copies all the objects from ImageEnMView to ImageEnVect. The only work-around that I can find is to get the object count from ImageEnVect instead of ImageEnMView.
procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin
  if ImageEnMView1.SelectedImage > -1 then
  begin
    { Clear }
    ImageEnVect1.RemoveAllObjects;
    ImageEnVect1.Clear;

    { Copy the selected IEBitmap to the background of ImageEnVect }
    ImageEnMView1.CopyToIEBitmap(idx, ImageEnVect1.IEBitmap);

    { Copy the annotations from ImageEnMView to ImageEnVect }
    if ImageEnMView1.MIO.Params[idx].ImageEnAnnot.IsEmpty = False then
    begin
      ImageEnMView1.MIO.Params[idx].ImageEnAnnot.CopyToTImageEnVect
        (ImageEnVect1);
      { Display the object count in the statusbar.  If ImagingAnnot.ObjectsCount is 0 then
        get the object count from ImageEnVect }
      if ImageEnMView1.MIO.Params[idx].ImagingAnnot.ObjectsCount <> 0 then
        StatusBar1.Panels[5].Text := 'Objects: ' +
          IntToStr(ImageEnMView1.MIO.Params[idx].ImagingAnnot.ObjectsCount)
      else if ImageEnMView1.MIO.Params[idx].ImagingAnnot.ObjectsCount = 0 then
      begin
          MessageDlg
            (PChar('ImageEnMView1.MIO.Params[idx].ImagingAnnot.ObjectsCount is 0. '
            + 'Getting the object count from ImageEnVect instead.'), mtWarning,
            [mbOK], 0);
        StatusBar1.Panels[5].Text := 'Objects: ' +
          IntToStr(ImageEnVect1.ObjectsCount);
      end;
    end;

    { Refresh the TImageEnVect }
    ImageEnVect1.Update;

    StatusBar1.Panels[3].Text := 'Frame: ' +
      IntToStr(ImageEnMView1.SelectedImage + 1);
  end;
end;

A simple demo that reveals the problem has been posted in the user demos here: http://www.xecute.com/ieforum/topic.asp?whichpage=3&TOPIC_ID=1446#8003

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