GDI+ Type Library (GDIPlus.TLB) version 1.31
Updated Wednesday, 01 Sep 2004 20:21:14 UTC

This Type Library (featured on VbAccelerator) provides everything you need to start working with GDI+ in Visual Basic giving you direct access to the native GDI+ functions. The TLB only exposes the Native(Flat) exports from the GDI+ DLL and not the C++ class methods.

Open Gdiplus.tlb with OleView.Exe to see in detail what is available.
   In v1.31 this is correct:
   Dim uClsidEncoder    As CLSID
   Dim uEncParams       As EncoderParameters

 GdipSaveImageToFile GpImagePtr, sFileName, uClsidEncoder, VarPtr(uEncParams)

GDIPlus.TLB  includes all the Constants, Declares, Enumerations and Structures(UDT) from the Platform SDK as well as some general Win API support:

GDIPlus.TLB Modules * *  


* Addition 11-Sep-2003 GdipAlloc and GdipFree
* Addition 11-Sep-2003 Misc. PointerNameStrings
* Bug Fix 11-Sep-2003 Change EncoderParameter in GdipSaveImageToFile, GdipSaveImageToStream, Long pointer. See note to the right concerning this problem.
* Bug Fix 02-Aug-2003 Fixed Declares which use IStream. Thanks to Zak Benjamin for pointing out this error.
* Bug Fix 03-Jul-2003 Fixed GdipGetImageThumbnail Declare.
* Bug Fix 03-Jul-2003 Updated PictDesc UDT member names to comply with PlatformSDK.


You must have the GDIplus.DLL package installed on your machine. See Requirements

To see the library in use, check out:

More related postings although not using this TLB can be found by searching 'GDI+' at

Code that works with internal declares may behave differently(even crash) using the Tlb. Most if not all of these problems can be traced to one or more of the following:

  • Incorrect parameter type in the TLB declare. Try a local declare to override the TLB to see if this is true. Please report any problems so we can fix it.
  • Passing illegal parameters.
  • Passing paramaters using the wrong format.
    For example encoderParams needs to be a structure in memory containing first a long variable containing count, followed by an array of arbitrary EncoderParameter structures. This must be laid out as a memory pointer and leads to a thorny coding problem in VB and in the Type Library: How do you declare the parameters you're going to pass if you don't know how many of them there are or anything about how their data is laid out in memory?
    There are no standard answers to these kinds of questions. The only real way around them is to work out what would be expected in memory and build it up as best you can, using a combination of structures, byte arrays, and memory allocations as required.
  • Not deleting objects that you create or trying to create a new object without first releasing the old one. At minimum this will cause a memory leak and quite often a GPF.

By using a TLB in lieu of Declares you not only eliminate cut and paste but more important is that your compiled Exe only includes the TLB items that are used.
Type Libraries are usually required only at design and compile time. Once the project that uses it is compiled the type library is not required anymore. So the library size does not matter because you do not have to include it in the installation package.

Another major advantage is that you can pass a Unicode string directly without having to use a Byte Array or StrPtr.

IStream, IPersistStream are not included. TLBs that support these interfaces can be found at:
Name URL Comments
OLELIB.TLB Supersedes Strm.Tlb
STRM.TLB Now included in OleLib.Tlb


Other Gdiplus TLBs available for Vb

Name URL Comments Type Library and Samples. 22 Oct 2003, 06:19 PM

Gdiplus Classes available for Vb

Name URL Comments Bitmap and graphics class wrappers. Latest version includes IStream and initial support for GdiPlus v6.
GpGDIPlus Wrapper v1.0 13 Class Wrappers
Genghis Khan
 GDIPlus (57K) VbAcceleratorGDI+ Wrapper Article 13 Class Wrappers
Copyright 2003 Steve McMahon