Help and Support
 

powered byLive Search

BUG: Error Message When You Try to Add an Icon to an ImageList Control: Invalid Parameter Used

Article ID:316652
Last Review:February 22, 2007
Revision:4.4
This article was previously published under Q316652
On This Page

SYMPTOMS

When you try to create an Image object from a 24-bits-per-pixel (BPP) or 16-BPP icon, you may receive an error message that is similar to the following:
OutOfMemory
Or, when you try to add a 24-BPP or 16-BPP icon to an ImageList control, or when you open an icon in a PictureBox control, you may receive the following error message:
Invalid Parameter Used

Back to the top

CAUSE

This behavior can occur because the System.Drawing method is based on GDI+. There is a bug in GDI+ that prevents it from loading certain 24-BPP and 16-BPP icons with no color tables. You may also experience this problem when you try to populate an ImageList control, because of the control's reliance on GDI+.

Back to the top

RESOLUTION

To work around this issue, use a 32-BPP or a 256-BPP icon instead of a 24-BPP icon.

Back to the top

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

Back to the top

MORE INFORMATION

Steps to Reproduce the Problem

1.Start Visual Studio .NET.
2.Create a new C# Windows application.
3.Add an ImageList control to the form.
4.Click the ellipsis button (...) in the Properties section of the form to edit the ImageList object collection.
5.Attempt to add a 24-BPP or 16-BPP icon. You receive an error message similar to the following:
Invalid Parameter Used

Back to the top


APPLIES TO
Microsoft GDI+ 1.0
Microsoft .NET Framework 1.0
Microsoft .NET Framework 1.1

Back to the top

Keywords: 
kberrmsg kbbug kbicon kbctrl kbdswgdi2003swept KB316652

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.