Article ID: 257523 - Last Review: October 15, 2002 - Revision: 1.0 BUG: Resource Leak Occurs When You Display WMF Files in a PictureBoxThis article was previously published under Q257523 On This PageSYMPTOMS
System and Graphical Device Interface (GDI) resources are not freed when you use a PictureBox control in Visual Basic to view multiple Windows MetaFile (WMF) images. Other image formats, such as BMP, JPG, and GIF, do not experience any resource leaks.
CAUSE
The resource leak is actually caused by a problem in the operating system. The operating system fails to destroy brushes that it creates to "play" a metafile image. Therefore, any application that uses the same operating system functionality to draw metafiles will experience the same loss in resources.
RESOLUTION
Currently, there is no known fix for this problem. One potential workaround, however, is to avoid the WMF file format and instead use another picture format, such as BMP, JPG, or GIF.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. MORE INFORMATION
This resource leak only affects WMF files displayed on a Windows 95 or 98 operating system. Files in other formats, such as BMP, JPG, and GIF, are not affected. In addition, resources are only leaked once for each WMF file. For example, if you load one WMF file into a PictureBox 10 times resources leak only once, but if you load 10 unique WMF files one time each this results in a loss of 10 times as many resources. Upon termination of the application, all leaked resources are released and available to the system. Steps to Reproduce Behavior
| Article Translations
|
Back to the top
