Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread TImage: Help Required
Fri, Jun 22 2012 5:31 PMPermanent Link

Mark Brooks

Slikware

Avatar

Hi,

Can anybody help me? I have an application that needs to display images from a server. The images can be quite large so I could need to scroll around them. To achieve this I can place a TImage into TPanel. If I then size the TImage as required (to simulate zoom etc) then the TPanel adds its scroll bars. Perfect. My issue, though, is that TImage has no autosize property nor does it tell me the native size of the loaded image! So, How can I size it accordingly?

Help!

PS. TImage also does not seem to refresh if I load the same URL a second or third time (this is valid in my app since the image behind the URL may change)
Tue, Jun 26 2012 5:25 AMPermanent Link

Matthew Jones

I expect Tim still has his head down. My thoughts though are on the refresh of the
image - I suspect that will primarily be a server based fix, as the browser will
ask the server for the header, and it should have some sort of no-cache option set
so that it will always be fetched again from the server.

A lot of these things will get ironed out in the first update, but it is looking
great so far.

/Matthew Jones/
Thu, Jun 28 2012 12:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< Can anybody help me? I have an application that needs to display images
from a server. The images can be quite large so I could need to scroll
around them. To achieve this I can place a TImage into TPanel. If I then
size the TImage as required (to simulate zoom etc) then the TPanel adds its
scroll bars. Perfect. My issue, though, is that TImage has no autosize
property nor does it tell me the native size of the loaded image! So, How
can I size it accordingly? >>

I've added these public properties to TImage in the build I just uploaded:

ImageHeight
ImageWidth

FYI: these *are* affected by the Stretch property.

<< PS. TImage also does not seem to refresh if I load the same URL a second
or third time (this is valid in my app since the image behind the URL may
change) >>

There was an issue with the way that the TImage was handling new URLs
(corrected in the new build), but that's different from this issue.  Matthew
is correct - when it comes to preventing the browser from caching images
with the same name, the only control you have over this is on the web server
side with a:

Cache-Control: no-cache

header in each image response.

Tim Young
Elevate Software
www.elevatesoft.com
Image