Solved

Windows Metafile Madness

Posted on 1997-07-22
1
328 Views
Last Modified: 2008-02-26
Ok here it goes... I have successfully dissected a Windows
Metafile. I have 2 questions that need to be answered in order for me to complete this Non-Windows C program. I have a nifty program that lists all the metafile records (functions and their arguments). For what I am doing, certain records are always the same (ie. I always incorporate a bitmap in my metafile so I always see the StretchDIB() GID function call in the .WMF dump). What I need to know is, What do I need to put as parameters in the Escape() functions and the StretchDIB function. Now I know the parameters are ALWAYS the same in the Escape() functions because their bit values are always the same. I don't know if this helps, but here is the values I always get when I dump a WMF file. From my testing, 2 bytes represent one number and the bytes are in reverse order (MSB then LSB)

Escape (34 bytes)
15   23   25922   26983   8302   24908   25977   144
0   7   24908   25977   8306   49

Escape (30 bytes)
15   20   24908   25977   8306   26966   26995   26978   26988   31092   0   1

Escape (20 bytes)
15   9   28229   8292   24908   25977   114

To get what I am showing you, I paste a .BMP file in Adobe Illustrator, export it as a Windows Metafile and view the list of records using a program called "listwmf.exe" from: www.CompanionSoftware.com

Since this program parallels a Windows C program, I may have to write a Windows C program instead that uses the Win32 GDI function calls instead of cutting and pasting their bits.

Now I need numbers for arguments in the StretchDIB() function since I am not writing a program, just manually creating the WMF from scratch.

If you cannot answer this, who can? And yes, I've already tried empire Microsoft.
0
Comment
Question by:jfoley053097
1 Comment
 

Accepted Solution

by:
thomasheller earned 200 total points
ID: 1252514
This is the entry for the StechDIBits Metafile Record from the Win31 help file, maybe this is what you need:

StretchDIBits Metafile Record

struct {
    DWORD rdSize;
    WORD  rdFunction;
    WORD  rdParm[];
}

Member      Description

rdSize      Specifies the record size, in words.
rdFunction      Specifies the GDI function number 0x0F43.
rdParm      Contains the following elements:

Element      Description

dwRop      Raster operation to be performed
Usag      Flag indicating whether the bitmap color table contains RGB values or indexes to the currently realized logical palette
srcYExt      Height of the source in the bitmap
srcXExt      Width of the source in the bitmap
srcY      Y-coordinate of the origin of the source in the bitmap
srcX      X-coordinate of the origin of the source in the bitmap
dstYExt      Height of the destination rectangle
dstXExt      Width of the destination rectangle
dstY      Y-coordinate of the origin of the destination rectangle
dstX      X-coordinate of the origin of the destination rectangle

BitmapInfo      BITMAPINFO structure
bits      Actual device-independent bitmap bits
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to organize data in excel ? 2 114
C Programming - If Statement 8 76
Acrinis True image 2 78
Resolve Dependency Issues 4 67
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question