willichan 220 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? Join me in supporting Pediatric Therapy Network through Amazon Smile. 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 Share this post Link to post Share on other sites
Yashied 241 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 HelperAnimated 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 LibraryAppropriate 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 alignmentMore... Share this post Link to post Share on other sites
willichan 220 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. Join me in supporting Pediatric Therapy Network through Amazon Smile. 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 Share this post Link to post Share on other sites
andygo 1 Posted March 30, 2011 what about gdi+ (bitmapclonearea and graphicsdrawimagerect) ? Share this post Link to post Share on other sites
UEZ 1,274 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Share this post Link to post Share on other sites
willichan 220 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 Join me in supporting Pediatric Therapy Network through Amazon Smile. 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 Share this post Link to post Share on other sites