VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Load and Resize Pictures with GDI+

by Miltiadis Kritikos (5 Submissions)
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (17 Votes)

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
Code 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+

Download Load and Resize Pictures with GDI+

Download Load and Resize Pictures with GDI+ (145 KB)

Load and Resize Pictures with GDI+ Comments

No comments have been posted about Load and Resize Pictures with GDI+. Why not be the first to post a comment about Load and Resize Pictures with GDI+.

Post your comment

Subject:
Message:
0/1000 characters