PRB: 'Invalid Picture' Error When Setting Metafile (WMF)Last reviewed: February 29, 1996Article ID: Q147667 |
The information in this article applies to:
SYMPTOMSSetting the Picture property of picture box control to a metafile (.WMF) format file can cause Visual Basic to raise the error 'Invalid Picture'.
CAUSEThis error can be caused when attempting to set the picture property to a kind of image that the control does not understand. If the file or other source of the image is corrupt then the control may not be able to interpret the image well enough to determine what kind of image it is, let alone display and manipulate it. With WMF (metafile) image formats, an additional wrinkle is relevant. Visual Basic 4.0, and other Microsoft products such as Microsoft Word and Microsoft Excel, do not use the 'standard' metafile format. Instead, these applications use an 'Aldus Placeable Format' metafile. The formats differ in that placeable metafiles include a 22-byte 'metafileheader' data structure at the beginning of the file. The placeable metafile format is incompatible with such Windows API functions as CreateMetaFile, GetMetaFile, CopyMetaFile, and PlayMetaFile.
WORKAROUNDSample code as well as compiled executables for utilities to convert between these metafile formats exist on the Microsoft Software Library (MSL). These samples are explained in the following Knowledge Base articles.
ARTICLE-ID: Q129658 TITLE : SAMPLE: Reading and Writing Aldus Placeable MetafilesThis provides a 16-bit utility that can convert between normal Windows metafiles and the corresponding Aldus Placeable Format metafiles.
ARTICLE-ID: Q145999 TITLE : SAMPLE: How to Create & Play Enhanced Metafiles in Win32This sample provides a 32-bit utility to work with the 32-bit enhanced metafile format. The utility can also convert between normal (16-bit) metafiles and Aldus Placeable Format metafiles.
STATUSThis behavior is by design.
REFERENCESQ129658 - SAMPLE: Reading and Writing Aldus Placeable Metafiles Q145999 - SAMPLE: How to Create & Play Enhanced Metafiles in Win32
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |