VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Load and Resize Pictures with GDI+

Miltiadis Kritikos  (5 Submissions)   Graphics   Visual Basic 5.0   Advanced   Wed 3rd February 2021

This module uses a combination of GDI+ and GDI API calls. Its functionallity is limited to loading images and resizing them. It can load all the picture formats supported by LoadPicture plus
the PNG file format.

Inputs
The module has two functions. LoadPictureGDIPlus and Resize. LoadPictureGDIPlus takes as parameters the filename, and optional desired width, height and backcolor if the picture is transparent. Resize takes as parameters the Picture handle, the picture type, desired width and height and an optional backcolor if the picture is transparent

Assumes
To run this demo you need to have gdiplus.dll installed on your system. XP users are fine since GDI+ is shipped with the OS. For any other Windows OS (not 95) you can download the GDI+ redistributable from http://download.microsoft.com/download/platformsdk/redist/3097/W98NT42KMeXP/EN-US/gdiplus_dnld.exe

Returns
Both functions return a new Bitmap Picture Object that can be directly set to a Picture property of a control.

Side Effects
The Resize function does not work with icon files (.ico and .cur).

Rate Load and Resize Pictures with GDI+ (17(17 Vote))

Download Load and Resize Pictures with GDI+

Load and Resize Pictures with GDI+ Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters