Jump to content

GUICtrlCreatePic() without stretch


 Share

Recommended Posts

Is there any way to put a picture on a GUI without stretching/scrunching it?

For example:

Global $frm_main_pic_bg = GUICtrlCreatePic("", 8, 48, 420, 148)
...
    GUICtrlSetImage($frm_main_pic_bg, $selected_pic)

When GUICtrlSetImage() sets the picture, it is resized to fit the 420x148 size of $frm_main_pic_bg. This leads to all kinds of image distortion when the GUI is resized. I would like to have just the part of the picture that fits the area displayed if the picture is larger than the display area, or the whole picture in its true size if the display area is larger.

Is there a way to accomplish this?

Link to comment
Share on other sites

GUICtrlSetPos()

Thank you for a quick reply.

Unfortunately, that will only move or resize the picture control. The picture displayed will still be stretched/squished to fit the size of the control. I could use it in cases where the dimensions of the image are smaller than the GUI, but when larger, I still get distortion.

To continue the example above, if the control is 420x148, and the image is 800x600, I only want the top-left 420x148 pixels of the image to display, not the whole image.

Link to comment
Share on other sites

Do you mean somethin' like this?

Yes, that is exacly what I needed. Thanks. Edited by willichan
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...