На главную

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 | Скачать Вниз

GetEnhMetaFilePaletteEntries



The GetEnhMetaFilePaletteEntries function retrieves optional palette entries from the specified enhanced metafile.

UINT GetEnhMetaFilePaletteEntries(

HENHMETAFILE hemf, // handle of enhanced metafile
UINT cEntries, // count of palette entries
LPPALETTEENTRY lppe // address of palette-entry array
);


Parameters

hemf

Identifies the enhanced metafile.

cEntries

Specifies the number of entries to be retrieved from the optional palette.

lppe

Points to an array of PALETTEENTRY structures to receive the palette colors. The array must contain at least as many structures as there are entries specified by the cEntries parameter.



Return Values

If the array pointer is NULL and the enhanced metafile contains an optional palette, the return value is the number of entries in the enhanced metafile's palette; if the array pointer is a valid pointer and the enhanced metafile contains an optional palette, the return value is the number of entries copied; if the metafile does not contain an optional palette, the return value is zero. Otherwise, the return value is GDI_ERROR.

Remarks

An application can store an optional palette in an enhanced metafile by calling the CreatePalette and SetPaletteEntries functions before creating the picture and storing it in the metafile. By doing this, the application can achieve consistent colors when the picture is displayed on a variety of devices.
An application that displays a picture stored in an enhanced metafile can call the GetEnhMetaFilePaletteEntries function to determine whether the optional palette exists. If it does, the application can call the GetEnhMetaFilePaletteEntries function a second time to retrieve the palette entries and then create a logical palette (by using the CreatePalette function), select it into its device context (by using the SelectPalette function), and then realize it (by using the RealizePalette function). After the logical palette has been realized, calling the PlayEnhMetaFile function displays the picture using its original colors.

See Also

CreatePalette, PALETTEENTRY, PlayEnhMetaFile, RealizePalette, SelectPalette


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

GetEnhMetaFilePaletteEntries



Функция GetEnhMetaFilePaletteEntries извлекает дополнительные данные палитры из определенного расширенного метафайла.

UINT GetEnhMetaFilePaletteEntries(

HENHMETAFILE hemf, // РУЧКА расширенного метафайла UINT cEntries, // счета данных палитры LPPALETTEENTRY lppe // адрес палитры-входа массива
);


Параметры

hemf

Идентифицирует расширенный метафайл.

cEntries

Определяет номер данных, которые нужно извлекаться из дополнительной палитры.

lppe

Точки на массив структур PALETTEENTRY, чтобы получать цвета палитры. Массив должен содержать по крайней мере столько структур сколько есть данные определялись параметром cEntries.



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

Если указатель массива НЕДЕЙСТВИТЕЛЕН и расширенный метафайл содержит дополнительную палитру, обратная величина является номером данных в расширенной палитре метафайла; если указатель массива является правильным указателем и расширенный метафайл содержит дополнительную палитру, обратная величина является номером скопированных данных; если метафайл не содержит дополнительную палитру, обратная величина нулевая. В противном случае, обратная величина - GDI_ERROR.

Замечания

Приложение может сохранить дополнительную палитру в расширенном метафайле вызывая CreatePalette и функции SetPaletteEntries перед создание изображения и хранения это в метафайле. Делая это, приложение может достичь последовательных цветов когда изображение отображено в ряде устройств.
Приложение, которое отображает изображение сохраненное в расширенном метафайле может назвать функцию GetEnhMetaFilePaletteEntries, чтобы определять существует дополнительная палитра. Если это делает, приложение может назвать функцию GetEnhMetaFilePaletteEntries вторично, чтобы извлекать данные палитры и тогда создайте логическую палитру (используя функцию CreatePalette), выберитесь это в свой контекст устройства (используя функцию SelectPalette), затем реализуйте это (используя функцию RealizePalette). После того, как логическая палитра будет реализована, вызывая функцию PlayEnhMetaFile отображает изображение, использовавшее оригинальные цвета.

Смотри Также

CreatePalette, PALETTEENTRY, PlayEnhMetaFile, RealizePalette, SelectPalette


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