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

mdgodfrey

USA
54 Posts

Posted - Aug 12 2014 :  11:57:37  Show Profile  Reply
I am trying to load tiff data from an existing table (data not created with ImageEn). I can connect and display the images with an ImageEnDBView component and all is well. When I try to display the same data with an ImageEnDBVect component the image does not display. Both components have AutoDisplay set to true and are connected to the same Datasource.

Any thoughts on what I am missing?
I want to add annotations to the data with the ImageEnDBVect component.

mdgodfrey

USA
54 Posts

Posted - Aug 14 2014 :  09:51:18  Show Profile  Reply
I notice no response on this question.
Not sure about that. I am wondering if the question is confusing or trivial or just no one knows?

Any help would be greatly appreciated!

It seems like both components should show the same result. The one thing that makes me wonder is that the ImageEnDBVect has a LoadedFieldImageFormat property that seems like maybe that data has to be stored with the image? Is that the difference and where my data was created with another application that it is not there?

Again any help appreciated.
Go to Top of Page

xequte

38616 Posts

Posted - Aug 14 2014 :  20:56:03  Show Profile  Reply
Hi

Both use virtually the same code, so it is hard to see why you might be getting a different result. Have you tried stepping through the ImageEn source code to see where it is failing?

Otherwise, you might want to send us a small demo that shows the issue.



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

xequte

38616 Posts

Posted - Aug 21 2014 :  16:58:33  Show Profile  Reply
Hi

Thanks for sending the demo. There are some differences between the methods used for I/O between the two components. I am currently investigating a resolution.

In the meantime, you may want to load directly from a blobstream:

http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=483



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

mdgodfrey

USA
54 Posts

Posted - Aug 27 2014 :  06:19:04  Show Profile  Reply
Thanks for the help.

I have a question about the way I am implementing loading Tifs.
It is now loading images but the FitToWidth only works after the first image is loaded. I have not been able to find a place in my code to get it to be recognized with the first image. Any thoughts on that?

I am using the following code:
procedure TfrmTIFViewer.tbScanAfterScroll(DataSet: TDataSet);
Var
 BlobStream : TStream;
 BlobField : TBlobField;
begin
 try
  BlobField := tbScan.FieldByName('FullImage') as TBlobField;
  BlobStream := tbScan.CreateBlobStream(BlobField, bmRead);
  ImageEnDBVect1.IO.LoadFromStreamTIFF(BlobStream);
  ImageEnDBVect1.FitToWidth;
  ImageEnDBVect1.IO.Update;
 finally
  BlobStream.Free;
 end;
end;



Thanks
Go to Top of Page

xequte

38616 Posts

Posted - Aug 27 2014 :  16:31:00  Show Profile  Reply
Hi

Are you sure that AutoFit and AutoShrink are set to false?

Also, you should not need to call update.

Use:
begin
  try
    ImageEnDBVect1.LockUpdate;
    BlobField := tbScan.FieldByName('FullImage') as TBlobField;
    BlobStream := tbScan.CreateBlobStream(BlobField, bmRead);
    BlobStream.Position := 0;
    ImageEnDBVect1.IO.LoadFromStreamTIFF(BlobStream);
    ImageEnDBVect1.FitToWidth;
  finally
    ImageEnDBVect1.UnlockUpdate;
    BlobStream.Free;
  end;
end;


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

xequte

38616 Posts

Posted - Aug 27 2014 :  16:35:36  Show Profile  Reply
Also, for other readers of this post. I forgot to mention the DB helper functions in iexHelperFunctions.pas (see your ImageEn source folder).

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

mdgodfrey

USA
54 Posts

Posted - Aug 27 2014 :  20:19:03  Show Profile  Reply
I appreciate the response and help.

In response to using the Update method. It would not display the Tiff without that before. Using the code you provided however does display properly without using update.

There still is the problem with the initial FitToWidth however.
I modified to code to ensure that Shrink and Stretch were disabled but it still won't FitToWidth until the second Tiff load.

My Code modification:
try
 ImageEnDBVect1.LockUpdate;
 BlobField := tbScan.FieldByName('FullImage') as TBlobField;
 BlobStream := tbScan.CreateBlobStream(BlobField, bmRead);
 BlobStream.Position := 0;
 ImageEnDBVect1.IO.LoadFromStreamTIFF(BlobStream);
 ImageEnDBVect1.AutoStretch := False;
 ImageEnDBVect1.AutoShrink := False;
 ImageEnDBVect1.FitToWidth;
finally
 ImageEnDBVect1.UnlockUpdate;
 BlobStream.Free;
end;


Thanks much
Go to Top of Page

mdgodfrey

USA
54 Posts

Posted - Aug 27 2014 :  20:39:41  Show Profile  Reply
On the FitToWidth issue it seems that the ImageEnDBVect component has to be visible before FitToWidth will make a change.
If I put FitToWidth in the Form.OnResize event it has the desired effect. It does not work in Form.OnShow however.
Go to Top of Page

xequte

38616 Posts

Posted - Aug 28 2014 :  02:01:48  Show Profile  Reply
Hi

Yes, that might be the case. Ensure the form is fully instantiated before using FitToWidth.

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: