На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

CreateEnhMetaFile



The CreateEnhMetaFile function creates a device context for an enhanced-format metafile. This device context can be used to store a device-independent picture.

HDC CreateEnhMetaFile(

HDC hdcRef, // handle to a reference device context
LPCTSTR lpFilename, // pointer to a filename string
CONST RECT *lpRect, // pointer to a bounding rectangle
LPCTSTR lpDescription // pointer to an optional description string
);


Parameters

hdcRef

Identifies a reference device for the enhanced metafile.

lpFilename

Points to the filename for the enhanced metafile to be created. If this parameter is NULL, the enhanced metafile is memory based and its contents are lost when it is deleted by using the DeleteEnhMetaFile function.

lpRect

Points to a RECT structure that specifies the dimensions (in .01-millimeter units) of the picture to be stored in the enhanced metafile.

lpDescription

Points to a string that specifies the name of the application that created the picture, as well as the picture's title.



Return Values

If the function succeeds, the return value is a handle to the device context for the enhanced metafile.
If the function fails, the return value is NULL.

Remarks

Where text arguments must use Unicode characters, use the CreateEnhMetaFile function as a wide-character function. Where text arguments must use characters from the Windows 3.x character set, use this function as an ANSI function.
Windows uses the reference device identified by the hdcRef parameter to record the resolution and units of the device on which a picture originally appeared. If the hdcRef parameter is NULL, it uses the current display device for reference.

The left and top members of the RECT structure pointed to by the lpRect parameter must be less than the right and bottom members, respectively. Points along the edges of the rectangle are included in the picture. If lpRect is NULL, the graphics device interface (GDI) computes the dimensions of the smallest rectangle that surrounds the picture drawn by the application. The lpRect parameter should be provided where possible.

The string pointed to by the lpDescription parameter must contain a null character between the application name and the picture name and must terminate with two null characters ѕ for example, "XYZ Graphics Editor\0Bald Eagle\0\0", where \0 represents the null character. If lpDescription is NULL, there is no corresponding entry in the enhanced-metafile header.
Applications use the device context created by this function to store a graphics picture in an enhanced metafile. The handle identifying this device context can be passed to any GDI function.

After an application stores a picture in an enhanced metafile, it can display the picture on any output device by calling the PlayEnhMetaFile function. When displaying the picture, Windows uses the rectangle pointed to by the lpRect parameter and the resolution data from the reference device to position and scale the picture.
The device context returned by this function contains the same default attributes associated with any new device context.
Applications must use the GetWinMetaFileBits function to convert an enhanced metafile to the older Windows metafile format.

The filename for the enhanced metafile should use the .EMF extension.

See Also

CloseEnhMetaFile, DeleteEnhMetaFile, GetEnhMetaFileDescription, GetEnhMetaFileHeader, GetWinMetaFileBits, PlayEnhMetaFile, RECT


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

CreateEnhMetaFile



Функция CreateEnhMetaFile создает контекст устройства для расширенного формата метафайла. Этот контекст устройства может быть использован, чтобы загружать машинонезависимое изображение.

HDC CreateEnhMetaFile(

HDC hdcRef, // РУЧКА в контекст устройства ссылки LPCTSTR lpFilename, // указатель в строку filename CONST RECT *lpRect, // указатель в прямоугольник bounding LPCTSTR lpDescription // указатель в дополнительную строку описания
);


Параметры

hdcRef

Идентифицирует устройство ссылки для расширенного метафайла.

lpFilename

Точки на filename для расширенного метафайла, который нужно создаваться. Если этот параметр НЕДЕЙСТВИТЕЛЕН, расширенный метафайл является памятью основанной и содержание потерено когда оно удалено использованием функции DeleteEnhMetaFile.

lpRect

Точки на структуру RECT, которые определяют измерения (на .01-millimeter устройствах) изображения, которые нужно загружаться в расширенный метафайл.

lpDescription

Точки на строку, которые определяют имя приложения, которое создавало изображение, а также картинное название.



Обратные Величины

Если функция добивается успеха, обратная величина является ручкой в контекст устройства для расширенного метафайла.
Если функция терпит неудачу, обратная величина НЕДЕЙСТВИТЕЛЬНА.

Замечания

Где текстовые аргументы должны использовать символы Уникода, используйте функцию CreateEnhMetaFile как широкую-символьную функцию. Где текстовые аргументы должны использовать символы из 3.x набора символов Windows, используйте эту функцию как функцию ANSI.
Windows использует устройство ссылки идентифицированное параметром hdcRef, чтобы записывать разрешение и устройства устройства на которых изображение первоначально появлялось. Если параметр hdcRef НЕДЕЙСТВИТЕЛЕН, он использует текущее дисплейное устройство для ссылки.

Левый и верхний участники структуры RECT указанной, чтобы параметром lpRect должны быть менее чем право и нижние участники, соответственно. Точки вдоль краев прямоугольника включены на изображение. Если lpRect НЕДЕЙСТВИТЕЛЕН, графический интерфейс устройства (GDI), вычисляет измерения минимального прямоугольника, который окружает изображение сделанным приложением. Параметр lpRect должен быть предусмотрен где возможно.

Строка указанная, чтобы параметром lpDescription должна содержать недействительный символ между прикладным именем и картинное имя и должно завершиться с двумя недействительными символами U например, "XYZ Graphics Editor\0Bald Eagle\0\0", где \0 представляет недействительный символ. Если lpDescription - НЕДЕЙСТВИТЕЛЕН, нет соответствуя входу в расширенном метафайле заголовка.
Приложения используют контекст устройства созданный этой функцией, чтобы загружать графическое изображение в расширенный метафайл. Ручка, опознающая этот контекст устройства может быть пройдена в любую функцию GDI.

После того, как приложение загрузит изображение в расширенный метафайл, оно может отобразить изображение на любом выходном устройстве вызывая функцию PlayEnhMetaFile. При отображении изображения, Windows использует прямоугольник указанный, чтобы параметром lpRect и разрешение данных с устройства ссылки, чтобы позиционировать и масштабировать изображение.
Контекст устройства возвращанный этой функцией содержит те же по умолчанию атрибуты связанные любым новым контекстом устройства.
Приложения должны использовать функцию GetWinMetaFileBits, чтобы преобразовывать расширенный метафайл в более старый формат метафайла Windows.

filename Для расширенного метафайла должен использовать расширение .EMF.

Смотри Также

CloseEnhMetaFile, DeleteEnhMetaFile, GetEnhMetaFileDescription, GetEnhMetaFileHeader, GetWinMetaFileBits, PlayEnhMetaFile, RECT


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz