Pictures

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques >

Pictures

Previous pageReturn to chapter overviewNext page

VPE can import many different image file formats:

Windows Bitmaps (2 / 16 / 256 / HiColor / True Color, RLE)

 

VPE Standard Edition and above:

Windows WMF (Placeable Metafile Format, Windows only)

Windows EMF (Enhanced Metafile Format, Windows only)

 

EMF and WMF is only supported on Windows platforms. If you should have problems importing metafiles (WMF), make sure you import a Placeable Metafile. A placeable metafile has a header with some additional information, which is required by VPE. See the Windows-SDK documentation on how the file header is structured.

 

In addition, the VPE Enhanced Edition and above support:

OS/2 Bitmaps (2 / 16 / 256 / HiColor / True Color)

TIFF 6.0 (2 / 16 / 256 / HiColor / True Color
LZW, PackBits, Fax G3, Fax G4, Multipage, RGBA, CMYK, RGB and Grayvalue with 16 Bits/Sample, JPEG compression v7, not the old 6.0 specification)

GIF (2 / 16 / 256 Color, Multipage)

PCX (2 / 16 / 256 / True Color)

JPG (256 / True Color, RGB / CMYK, Standard and Progressive JPEG)

PNG (all possible formats)

ICO (Windows Icon)

JNG (JPEG Network Graphics)

KOA (C64 Koala Graphics)

IFF/LBM (Interchangeable File Format - Amiga/Deluxe Paint)

MNG (Multiple-Image Network Graphics)

PBM (Portable Bitmap [ASCII])

PBM (Portable Bitmap [RAW])

PCD (Kodak PhotoCD, reads always the 768 x 512 pixel image)

PGM (Portable Greymap [ASCII])

PGM (Portable Greymap [RAW])

PPM (Portable Pixelmap [ASCII])

PPM (Portable Pixelmap [RAW])

RAS (Sun Raster Image)

TGA/TARGA (Truevision Targa)

WAP/WBMP/WBM (Wireless Bitmap)

PSD (Adobe Photoshop, only 24-bit RGB or 24-bit RGB RLE, no layers / masks)

CUT (Dr. Halo)

XBM (X11 Bitmap Format)

XPM (X11 Pixmap Format)

DDS (DirectX Surface)

HDR (High Dynamic Range Image)

G3 (Raw fax format CCITT G.3)

SGI (SGI Image Format)

 

Images are imported and placed into a document by calling the method Picture().

VPE is a WYSIWYG system. Therefore, if you are using VFREE for x2 and/or y2 in the call to the method Picture(), VPE will read the image header (this is much faster than reading the whole image, like most other tools do) to determine the picture's dimensions in metric coordinates. The dimensions are computed based on the resolution information found in the image and its size in pixels.

This means, it computes the width and height of an image by extracting the DPI information included in the image file. For example a width of 96 pixels and a resolution of 96 DPI mean that the image is "in reality" one inch wide. A width of 900 pixels and a resolution
of 300 DPI mean that the image is "in reality" three inch wide, etc.

Examples:

DLL:

VpeSetPenSize(hDoc, 0);        // no frame drawn around the picture

VpePicture(hDoc, 1,  1, VFREE, VFREE, "test.jpg");

 

ActiveX / VCL:

Doc.PenSize = 0                        // no frame drawn around the picture

Doc.Picture(1,  1, VFREE, VFREE, "test.jpg")

 

.NET:

Doc.PenSize = 0;                        // no frame drawn around the picture

Doc.Picture(1,  1, Doc.nFree, Doc.nFree, "test.jpg")

 

Java:

Doc.setPenSize(0);                        // no frame drawn around the picture

Doc.Picture(1,  1, Doc.nFree, Doc.nFree, "test.jpg")

 

Inserts the image "test.jpg" at the position (1, 1). The width and height of the image are computed by VPE.

If an image should be drawn incorrectly in size, this results from wrong resolution and / or size information stored in the image file. You have two options to workaround this problem:

Use a good image processing software, where you can change the DPI
resolution in the image-file to a reasonable value

You can stretch the images in VPE by using absolute values for x2 / y2

 

NOTE:Special care must be taken, when creating VPE document files that contain pictures. By default, images are embedded into VPE document files, but you can turn this behavior off. For details, please see “Pictures and VPE Document Files”.