WebImageView and WebCanvas corrupt images

I have a standalone web app that I’m having challenges with WebCanvas and WebImageView. The app reads a SQL 2008 database to get pictures and then populates each control. On my Dev systems (MBP and Windows 2003/SQL 2008 R2) it runs fine.

On my Windows 2003/SQL 2008 production system the bottom half of the image is cutoff in both controls.

I’m thinking it’s related to the OS and tried to tinker around with Application.USEGDIPlus, but it won’t compile on the MBP.

I’ve read a little about GDI+ and Quicktime issues.

I’d put a picture here to show you but I have not mastered that skill on this forum.

Anyways, any thoughts?

Xojo 2014 Release 1.1

Forgot one other detail, once in a while I get an UnsuportedFormatException.

I’ve added a check using IsImportedFormatSupported thinking that was the problem.

It sounds like the webimageview object is going out of scope before the browser finishes grabbing it.

Place the picture on your server and use the Link icon (green right arrow over globe) to enter the URL of the image.

Here’s a redacted screen shot:

As you can see the bottom half of the image is somewhat corrupted. As I mentioned, my MBP and my DEV W2K3 servers work fine.

It’s my production W2K3 server that has this issue.

Code snippet on main form using WebImageView (picItem):

    mImage = rs2.Field("picture").PictureValue
    if mImage.IsImportFormatSupported(mImage.FormatJPEG) then
      DrawPicture(picItem, mImage, 180, 180)
      msgbox "Picture format NOT supported"
    end if 

I also have added a buttom with this code to try to load a WebCanvas: (that is the picture above)

PicItemDialog1.mImage1 = mImage

On the Paint event of the WebCanvas:

g.DrawPicture( mImage1, me.width /2 - mImage1.width /2 , me.height /2 - mImage1.Height /2 )
g.DrawRect ( 0,0, g.width, g.height)

Both WebImageView and WebCanvas look like this picture.
How do I prevent it from going out of scope? Thanks for any input.

At one point in 2013 there was an issue with images on Windows Desktop, but it does not seem to be the same.

That does not look good indeed. You may want to load the picture in your web space and address it in the IDE as URL instead of loading it in the code. Loading will be faster and it may take care of the bug.

The way to prevent it from going out of scope is to define the variable outside of the method (like a class or WebPage property), and make sure you don’t reuse that property until you are done with it.

Ok, here’s the deal -

As I suspected it was the Windows 2003 Server and nothing with Xojo. The SQL driver I was using on my dev system is an older one than on my production system. I reconfigured the ODBC Connection on my production system with the older driver and it works perfectly!

There is probably some setting that I’ll need to figure out to be able to use the newer one, but it works for now, and very nicely.

Anyways, thanks for the comments.