Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Layouts Thumbnail and Pan

I pretty much always have my picture controls layout set to thumbnail. In the last couple of days I was trying some images and they were clipping rather than thumbnailing. I didn't have time to debug so I switched to Pan which worked as expected and provided the added bonus of double click zoom. I thought cool, that'd be much better in this use case.

Then I gave an update to someone else to test and the first image they tried was so big that they had to double right click a few times before they saw anything at all really. However before the picture got small enough to see the whole image, it disappeared altogether which implies zooming out only works to a point.

I switched back to thumbnail and that image thumbnails perfectly, just the way I expected all the images to do.

So there's the background and my two questions are
1. What would prevent an image from being displayed as a thumbnail and clip instead?
2. Why would zooming out x number of times make an image which is still to big to display in it's entirety, disappear altogether?

Most importantly I guess I don't necessarily need details about these but rather is there anything I can do about it?

Comments

  • 1. I'm not sure without seeing the code or the image.
    2. The zoom level increases/decreases by a fixed percentage of the image size. The bigger the image, the bigger that change for each zoom level. Thus, a particularly large image will be too large at 10% and invisible at 0%.
  • edited April 2019
    1. set_property(ole_picture$, "OLE.Layout", "Thumbnail") Set_Property(ole_picture$, "OLE.Image", someimage)Try this pic

    2. That makes sense thanks. 100%, 80%, 60%, 40%, 20%, gone...
  • Just had a client report the thumbnail not displaying as a thumbnail issue.
    Here's their screenshot

    The image I linked to above does the same thing, yet other images behave as expected.
  • I wonder if the picture control just doesn't realizes it needs to refresh itself. When is the picture loaded? During READ or CREATE?
  • edited April 2019
    It happens with both the autodisplay during onfiledrop or if you set the image during a read or if you set the image after clicking on the button under the picture there that says "Next Image".
    Not during "CREATE"
  • @kevinfournier, did you manage to replicate this issue with the image I linked to above?
  • So how relevant is the images metadata to determining what to do with the image so far as the layout is concerned?
    I don't have the image handy from the screenshot above but the images I do have that weren't working have little to no metadata returned using the getmetadata methods.
    Is there a correlation there perhaps?
  • This has cropped up again for the same client, basically because we never really got to the bottom of it.
    This time I got a copy of the image they were using. It's a jpeg if that makes any difference.

    Here's a new element for the melting pot of possibilities.
    I have two different picture controls (in two different applications/copies of OI). They are both initialised the same way using the same code. I copied/pasted from one system to the other just to be sure.
    In one system, it does indeed display as a thumbnail, in the other it doesn't.

    Same laptop so same control.
    Basically the initialisation is as above. Set the layout to thumbnail on the create.
    On the read set the image property.

    Here's the results side by side.


    The only other difference I can think to look at is the version of OI. The working one is 9.4.2, the other is 9.4.4
  • edited October 2020
    Bumping because it's been brought up by the client again.
    This time I've identified an even closer comparison. Same application. Same Image. Different windows only. The initialisation of the control is the same because it's a generic function.
    Debugging shows that the offending control sure thinks its layout is Thumbnail immediately before setting the image yet it still clips it.

    Here's a closer look. What is your layout? Thumbnail. Ok. Set_Property. Stare at clipped version of image

  • edited October 2020
    I'm not able to recreate this. One theory is that this is a redraw issue. The layout has been set, but the control is not refreshing. What happens if you force a refresh?
  • No change.
  • I created a new form and put just the key and description editlines and the picture control and added just the create and read events and then saved it with the same name as the original form, overwriting it.
    It works as expected.
    Oddly, I had tried this from the reverse approach by removing all other controls from the original form so that I was left with the same thing and that's what I posted above.

    I'll play some more and see what happens. It's too complex a form to start again from scratch.


  • That's the offending image this time.
    Here's some more easily reproducible symptoms.
    Sequence 1
    • I removed the picture control from the form.
    • Saved the form.
    • Closed the form designer.
    • Run the form.
    Sequence 2
    • Open the form designer.
    • Add the picture control.
    • Save the form.
    • Close the form designer.
    • Run the form. Image shows as thumbnail, just the way I want it.
    Sequence 3
    • Open the form designer.
    • Adjust the picture control to the size I actually want it 220 *220.
    • Save the form.
    • Close the form designer.
    • Run the form. Image clips.
    Sequence 4
    No matter what I do now to the size of the control, it continues to clip. I have to go back to sequence 1 followed by sequence 2 to get it back to showing as a thumbnail.
    I don't know why but something about displaying that image in a control of 220*220 screws up the layout and it remains screwed up.
    Makes no sense to me but I've repeated the above sequences about four times now to ensure it's repeatable.
  • Kudos. You found the edge case. This is in fact a bug, and the humble pie was a tad bitter. This issue only occurs when the picture control is the exact same width/height ratio as the image. SRP Controls 4.1.13.2 will fix this.
  • For reference, I have just upgraded and tested and all successful.
    Thanks Kev.
Sign In or Register to comment.