willichan Posted March 30, 2011 Share Posted March 30, 2011 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? My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Yashied Posted March 30, 2011 Share Posted March 30, 2011 GUICtrlSetPos() My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
willichan Posted March 30, 2011 Author Share Posted March 30, 2011 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. My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
andygo Posted March 30, 2011 Share Posted March 30, 2011 what about gdi+ (bitmapclonearea and graphicsdrawimagerect) ? Link to comment Share on other sites More sharing options...
UEZ Posted March 30, 2011 Share Posted March 30, 2011 Do you mean somethin' like this?: Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
willichan Posted March 31, 2011 Author Share Posted March 31, 2011 (edited) Do you mean somethin' like this?Yes, that is exacly what I needed. Thanks. Edited March 31, 2011 by willichan My UDFs: Barcode Libraries, Automate creation of any type of project folder, File Locking with Cooperative Semaphores, Inline binary files, Continue script after reboot, WinWaitMulti, Name Aggregator, Enigma, CornedBeef Hash Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now