Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, October 24, 2008 9:32:29 AM(UTC)

TEG  
TEG

Groups: Registered
Posts: 2


Greetings.
I am a developer using LEADTOOLS version 11.5 in Visual Basic 6.0, and I am working on an application that uses the LEAD Main Control component (LTOCX11N.ocx version 11.5.0.8) to help do some image conversion with diagrams that are used.
Our diagram tool successfully generates a metafile (*.wmf) which contains the diagram.  There then exists code that uses the
LoadPicture function to load the .wmf file into a StdPicture object.  (All .wmf files are able to be successfully read into the StdPicture object.)  After the diagram has been loaded into the StdPicture object, the LEAD object is then used.  The SetPicture function is used with the StdPicture object.  Most of the time this works without issue; however, there has been an issue where this sometimes yields a “Run-time error ‘20001’: LEAD Error: Not enough memory available” when using the SetPicture function.
After investigating the issue, I noticed a pattern: every time that the SetPicture function yielded the “Out of Memory” error, the .Height property of the StdPicture object contained a negative value.  No other .wmf file causes this error except those that contain that negative .Height value.
I was hoping that there might be some information on what would cause this error with the SetPicture function, and if there was way it could be circumvented.
Attached to this message is a zip file containing a sample VB6 project (along with the compiled .exe file, and two .wmf files: one that works correctly, and one that does not) which should illustrate the error that we are getting.
Here is a snapshot of the relevant code used to reproduce the error:
======================================================
Private Sub Command1_Click()
    Dim picvalue As StdPicture
    Set picvalue = LoadPicture("working_file.wmf")
    MsgBox "Working height from file = " & CStr(picvalue.Height)
    LEAD1.SetPicture picvalue
    Dim picvalue2 As StdPicture
    Set picvalue2 = LoadPicture("nonworking_file.wmf")
    MsgBox "Non working height from file = " & CStr(picvalue2.Height)
    LEAD1.SetPicture picvalue2
End Sub
=======================================================
Any information you may have that would help us sort out this issue would be greatly appreciated.  I’ll look forward to hearing back from you.
Thanks for your time.
File Attachment(s):
testproject.zip (16kb) downloaded 23 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, October 26, 2008 5:23:08 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

When the Picture object has a negative height value, this usually indicates the image is stored in upside down orientation. You're right about our Main OCX not accepting pictures of this type. Unfortunately, since LEADTOOLS 11 has been out of production for years now, I cannot report this issue to our engineers.
However, our control should be able to load the WMF file directly using the Load method. If this fails due to the image's very high resolution, you can change it to a reasonable value like this:
LEAD1.WMFResolution = 600
LEAD1.Load "nonworking_file.wmf", 24, 0, 1
 
#3 Posted : Tuesday, October 28, 2008 3:23:33 AM(UTC)

TEG  
TEG

Groups: Registered
Posts: 2


I am able to load the .wmf file using the code you suggested above, so I created a coding work-around that I am hopeful will resolve the situation we have.

Thanks for your help. I will be in touch if I encounter any more issues I need assistance with.

Thanks again!
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.072 seconds.