Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2013.10.13;
Скачать: [xml.tar.bz2];

Вниз

Сохранить скриншот неактивной формы   Найти похожие ветки 

 
denkop   (2011-09-08 18:30) [0]

Есть некоторая форма, которая ещё ни разу не открывалась после запуска программы. Возможно ли сохранить скриншот этой формы чтобы не показывать её пользователю?


 
Rouse_ ©   (2011-09-08 19:11) [1]

WM_PRINT - но не факт что целиком получишь изображение...
Обычно двигают ее по отрицательным координатам и там уже BitBlt()


 
denkop   (2011-09-09 13:21) [2]

В реальной задаче это одна из вкладок TPageControl, с этим как быть, подскажите.


 
Cobalt ©   (2011-09-09 15:21) [3]

Есть подозрение, что вы пытаетесь сделать что-то необычное.
с TPageControl скорее всего придется его переключить.


 
han_malign   (2011-09-09 15:33) [4]

тогда WM_PRINTCLIENT можно попробовать
procedure TWinControl.WMPrintClient(var Message: TWMPrintClient);
begin
 with Message do
   if Result <> 1 then
     if ((Flags and PRF_CHECKVISIBLE) = 0) or Visible then
       PaintHandler(TWMPaint(Message))
     else
       inherited
   else
     inherited;
end;

procedure TWinControl.PaintHandler(var Message: TWMPaint);
...
begin
 DC := Message.DC;
 if DC = 0 then DC := BeginPaint(Handle, PS);
 .......

- а можно тупо - через трюк доступа к protected методу - PaintHandler вызвать...


 
brother ©   (2011-09-14 04:17) [5]

> WM_PRINT - но не факт что целиком получишь изображение...

так вроде уже обсуждали, что не актиное окно не обязано быть отрисовано полностью или вообще быть отрисовано? что-то изменилось?


 
DVM ©   (2011-09-16 00:12) [6]


> brother ©   (14.09.11 04:17) [5]


> что не актиное окно не обязано быть отрисовано полностью
> или вообще быть отрисовано? что-то изменилось?

в Win7 по всей видимости изменилось, иначе бы на панели задач не было бы превьюшек окон в подсказках всплывающих.


 
brother ©   (2011-09-16 03:39) [7]

кстати да, 7 меняет ситуацию


 
Sam Bellamy   (2011-09-16 15:13) [8]

попробуйте  Forms.Screen.CustomForms[FormIndex].GetFormImage; может получится


 
brother ©   (2011-09-19 06:02) [9]

> может получится

а зачем гадать на кофейной гуще?


 
denkop   (2011-09-22 14:39) [10]

проблема решена, как обычно оказалось всё гораздо проще чем на самом деле

Draws the windowed control to a device context.

Delphi syntax:

procedure PaintTo(DC: HDC; X, Y: Integer);

C++ syntax:

void __fastcall PaintTo(HDC DC, int X, int Y);

Description

Call PaintTo to draw the control on a device context. Specify the device context as the value of the DC parameter and specify the X and Y coordinates on the device context where the top-left corner of the windowed control is to be drawn. PaintTo first erases the background of the device context and then paints the control.

PaintTo is useful for drawing an image of the control into a bitmap DC.

Warning: When using PaintTo to draw on a canvas, you must lock the canvas first (and unlock it after the call to PaintTo. If you do not lock the canvas, Windows calls that occur while the control is painting can cause the canvas to lose its handle.


всем спасибо!



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2013.10.13;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.002 c
15-1367699402
Юрий
2013-05-05 00:30
2013.10.13
С днем рождения ! 5 мая 2013 воскресенье


15-1367652485
Дмитрий С
2013-05-04 11:28
2013.10.13
Запуск от имени администратора моей программы.


1-1316547907
adigozelov
2011-09-20 23:45
2013.10.13
How to compare two object


2-1358713890
Очень Злой
2013-01-21 00:31
2013.10.13
Вопросик по указателям


15-1367526602
Юрий
2013-05-03 00:30
2013.10.13
С днем рождения ! 3 мая 2013 пятница





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский