Jump to content

Display an image file with scrolling rather than scaling


Recommended Posts

I am working on how to get an image to display in a very simple GUI.

The problem I have encountered is that when the image is bigger than the GUI, Autoit will down-scale the image to be the size of the control.

What I want to do is to add scroll bars to the pic control so I can scroll around and look at the entire image without scaling.

This doesn't sound too difficult but I haven't been able to figure out how to do this and have been searching a couple of days for the solution.

If I use something like:

$NotifyPic = GuiCtrlCreatePic("today.gif",0,0,100,200,$WS_VSCROLL)

Then I get a scroll bar but the image is still scaled to fit the window so scrolling is not possible.

Can anyone enlighten me?

Thanks very much

Phil

Link to comment
Share on other sites

I am working on how to get an image to display in a very simple GUI.

The problem I have encountered is that when the image is bigger than the GUI, Autoit will down-scale the image to be the size of the control.

What I want to do is to add scroll bars to the pic control so I can scroll around and look at the entire image without scaling.

This doesn't sound too difficult but I haven't been able to figure out how to do this and have been searching a couple of days for the solution.

If I use something like:

$NotifyPic = GuiCtrlCreatePic("today.gif",0,0,100,200,$WS_VSCROLL)

Then I get a scroll bar but the image is still scaled to fit the window so scrolling is not possible.

Can anyone enlighten me?

Thanks very much

Phil

One way might be to set the image to include $SS_REALSIZEIMAGE in it's styles and not have scroll bars at all for the image. Then put the image in a child window which has both vertical and horizontal scroll bars.

Haven't tried this, just an idea.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 2 years later...

One way might be to set the image to include $SS_REALSIZEIMAGE in it's styles and not have scroll bars at all for the image. Then put the image in a child window which has both vertical and horizontal scroll bars.

Haven't tried this, just an idea.

I have the same problem.

I checked the link http://www.autoitscript.com/autoit3/docs/appendix/GUIStyles.htm#Label and didn't see a description of $SS_REALSIZEIMAGE. Is there any other documentation on $SS_REALSIZEIMAGE somewhere else? Some time has now passed since the first post.

Philip, can I ask you if in the end you managed to find a solution to the problem?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...