AddEmbeddedImageAnnotInteractive not working

Discussions about annotation support.
Post Reply
User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

AddEmbeddedImageAnnotInteractive not working

Post by AgfaDev » Mon Aug 08, 2022 8:36 am

Hi,

We were using AddEmbeddedImageAnnotInteractive and AddEmbeddedImageAnnotInteractive_2 without problems on GdPicture 14.0.0.4
Now we have upgraded to (legacy) 14.1.0.121 and these annotations can not be added.

Calling these methods normally changes the cursor into a selection icon and when clicking the main image, the event AnnotationAddedByUser would be triggered and the annotation image is placed.

Now, the method call does not change the cursor and no event is triggered.
When GetStat is used, error 0.5 is returned (which is strange as it should be an integer).

All other annotations work like expected. It is only the embedded image annotation which fails.

Did something change between the versions?
Or could it be a bug in 14.1.0.121?

More info:
GdPicture .NET COM/ActiveX 14.1.0.121

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: AddEmbeddedImageAnnotInteractive not working

Post by Hugo » Mon Aug 08, 2022 3:10 pm

Hi there,

Thank you for your question.

Regarding this, could you be more specific as to what behavior you are now getting on your end please? You mention getting an error 0.5.
Could you provide me with a code project I can use on my end to reproduce the behavior please? This is so we may further understand the issue and get to the cause of the issue.

Regards,
Hugo Cudd
Technical Support

User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Re: AddEmbeddedImageAnnotInteractive not working

Post by AgfaDev » Wed Aug 10, 2022 9:24 am

Hi,

It is difficult to provide a sample as we are using SqlWindows as development system.
But in fact, the GdPicture setup installs a VB6 sample for annotations which is fairly similar and also has an issue with calling AddEmbeddedImageAnnotInteractive_2

I use the sample from here:

GdPicture.NET 14\Samples\WinForm\vb6 using com interop\annotations

At the moment you try to add image annotation, this error pops up:
GdPIcture_VB6_AnnotError.png

And debugging shows this location in the VB6 code:

GdPIcture_VB6_CodeError.png

I guess we have the same issue in our development system. All the other annotation types work fine except this specific function which fails.
As like VB6, we use the COM interop (32bit) of GdPicture 14.1.0.121.

So the provided VB6 sample can be used to investigate the issue.

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: AddEmbeddedImageAnnotInteractive not working

Post by Hugo » Thu Aug 11, 2022 3:50 pm

Agfa,

Thanks for providing more information.

It is VERY likely this issue is fixed as the release you are using was published 13 months ago. Since then we have pushed rather big improvements overall of the stability of our SDK aswell as fixed countless bugs which occured in our previous versions.

Would you be able to update and check this bug still occurs for you in our latest version?
https://www.gdpicture.com/download-gdpicture/

From these 2 different versions, the very same code you are currently using should work in both versions.

I'll be waiting to hear back from you.

Regards,
Hugo Cudd
Technical Support

User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Re: AddEmbeddedImageAnnotInteractive not working

Post by AgfaDev » Fri Aug 19, 2022 8:56 am

Hi,

I have finished my investigation and have found that also the latest GdPicture 14.1.0.185 has an issue with image annotations.
The VB6 sample fails and also c# project fails when using the overloaded AddEmbeddedImageAnnotInteractive and AddEmbeddedImageAnnotInteractive_2 methods.

I have created a c# project which just opens an image and two buttons to add image annotation:
one button works and the other does not.

I have found that when using COM and native .NET there is a difference between the "original" method which passes the colors as Color type and the COM interfaces which passes the color as LONG.

See the attached sample application. Here the code of the working and not working part:

Code: Select all

        private void button2_Click(object sender, EventArgs e)
        {
            // This works
            gdViewer1.AddEmbeddedImageAnnotInteractive("", false, Color.White, (float)(0.02), 1);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            // This doe snot work. THe image is not added
            gdViewer1.AddEmbeddedImageAnnotInteractive_2("", false, Color.White.ToArgb(), (float)(0.02), 1);
        }
In the COM interface there is no method to pass the color as Color type so in VB6 and in our SqlWindows application we must use the method to pass the color as LONG (or int). So the same way as above, the call using AddEmbeddedImageAnnotInteractive_2.

In VB6 sample (as provided by the GdPIcture installer we get the error described in the start post.
In the C# application provided here as attachment it does not give an error but the annotation is not added.
GdPictureAnnotFail.png
So there is definitely something wrong in the COM interface.
Attachments
GdPictureTesterNET.zip
(10.98 KiB) Downloaded 324 times

User avatar
AgfaDev
Posts: 33
Joined: Thu Sep 12, 2013 7:48 am

Re: AddEmbeddedImageAnnotInteractive not working

Post by AgfaDev » Tue Aug 23, 2022 10:47 am

Any progress on this issue?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest