Форум программистов «Весельчак У»
  *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: [1]   Вниз
  Печать  
Автор Тема: Вывод на экран данных документа  (Прочитано 5518 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Kostia
Гость
« : 19-06-2008 20:51 » 

Если кто может,помогите разобраться с вопросом "Механизм отображения данных на экран" , в качестве примера,пытался разобраться с отображением метафайла на экране,но запутался ппц,помогите плз Скромно так...
Записан
Алексей++
глобальный и пушистый
Глобальный модератор

ru
Offline Offline
Сообщений: 13


« Ответ #1 : 20-06-2008 03:31 » 

для контекст-девайса есть такая метОда  (только я никогда не пользовался ещё Улыбаюсь )
Код:
The PlayMetaFile function displays the picture stored in the given Windows-format metafile on the specified device.

Note  This function is provided only for compatibility with Windows-format metafiles. Enhanced-format metafiles provide superior functionality and are recommended for new applications. The corresponding function for an enhanced-format metafile is PlayEnhMetaFile.

BOOL PlayMetaFile(
  HDC hdc,        // handle to DC
  HMETAFILE hmf   // handle to metafile
);
Parameters
hdc
[in] Handle to a device context.
hmf
[in] Handle to a Windows-format metafile.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

Remarks
To convert a Windows-format metafile into an enhanced format metafile, use the SetWinMetaFileBits function.

A Windows-format metafile can be played multiple times.

A Windows-format metafile can be embedded in a second Windows-format metafile by calling the PlayMetaFile function and playing the source metafile into the device context for the target metafile.

Any object created but not deleted in the Windows-format metafile is deleted by this function.

To stop this function, an application can call the CancelDC function from another thread to terminate the operation. In this case, the function returns FALSE.

Requirements
  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.

где брать хендл метафайла - вопрос отдельный, надо рыться...
Записан

zubr
Гость
« Ответ #2 : 20-06-2008 04:23 » new

Чтобы получить хендл метафайла, надо его создать: CreateMetaFile. Но лучше использовать CreateEnhMetaFile и соответственно PlayEnhMetaFile, так как не enh-функции для 16-битной Windows. Смысл прост: после создания метафайла (его можно создать как на диске, так и в памяти), хендл метафайла используется как контекст устройства при работе с функциями GDI, в результате все действия GDI запоминаются в метафайле. В msdn для большинства функций по работе с метафайлами есть примеры.
Записан
Страниц: [1]   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines