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?
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
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%.
set_property(ole_picture$, "OLE.Layout", "Thumbnail") Set_Property(ole_picture$, "OLE.Image", someimage)
Try this pic2. That makes sense thanks. 100%, 80%, 60%, 40%, 20%, gone...
Here's their screenshot
The image I linked to above does the same thing, yet other images behave as expected.
Not during "CREATE"
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 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
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
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
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.
Thanks Kev.