Loads and displays an image in a picture box.
Takes pictureBoxID (Int), imagePath (String), and resize (Int).
Returns 1 on success, 0 if picture box not found or image load fails.
BGI GUI
Parameters & Returns
Parameters
pictureBoxIDInt
imagePathString
resizeInt
Returns
Int
Quick Summary
Loads and displays an image in a picture box.
Takes pictureBoxID (Int), imagePath (String), and resize (Int).
Returns 1 on success, 0 if picture box not found or image load fails.
Technical Exegesis...
Loads an image file and displays it in a picture box control. Searches gizmoMap for the picture box ID. Loads the image from file using GDI+ (supports PNG, JPG, BMP, GIF formats via LoadImageFromFile). If resize is non-zero (true), resizes the picture box control to match the image dimensions. If resize is zero (false), keeps picture box size unchanged and scales image to fit. Converts loaded image to HBITMAP and sends to control with STM_SETIMAGE message.
Loads an image file and displays it in a picture box control. Searches gizmoMap for the picture box ID. Loads the image from file using GDI+ (supports PNG, JPG, BMP, GIF formats via LoadImageFromFile). If resize is non-zero (true), resizes the picture box control to match the image dimensions. If resize is zero (false), keeps picture box size unchanged and scales image to fit. Converts loaded image to HBITMAP and sends to control with STM_SETIMAGE message. Returns 1 on success, 0 if picture box not found or image load fails.
The image file path can be absolute or relative. Supports transparency in PNG images. When resize=true, the picture box automatically adjusts to the exact image dimensions. When resize=false, the image is scaled (stretched or shrunk) to fill the picture box area. Use this function to dynamically change displayed images (for slideshows, previews, or dynamic icons). Previous image is replaced when loading a new one.