Недавно добавленные исходники

•  Animation Loaders  778

•  DeLiKaTeS Tetris (Тетрис)  5 753

•  TDictionary Custom Sort  7 711

•  Fast Watermark Sources  7 393

•  3D Designer  10 609

•  Sik Screen Capture  7 919

•  Patch Maker  8 150

•  Айболит (remote control)  8 196

•  ListBox Drag & Drop  6 999

•  Доска для игры Реверси  100 319

•  Графические эффекты  8 275

•  Рисование по маске  7 651

•  Перетаскивание изображений  6 255

•  Canvas Drawing  6 628

•  Рисование Луны  6 550

•  Поворот изображения  5 713

•  Рисование стержней  4 649

•  Paint on Shape  3 350

•  Генератор кроссвордов  4 322

•  Головоломка Paletto  3 476

•  Теорема Монжа об окружностях  4 295

•  Пазл Numbrix  2 781

•  Заборы и коммивояжеры  3 701

•  Игра HIP  2 496

•  Игра Go (Го)  2 486

•  Симулятор лифта  2 884

•  Программа укладки плитки  2 317

•  Генератор лабиринта  3 044

•  Проверка числового ввода  2 547

•  HEX View  2 950

 
скрыть

  Форум  

Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Как отловить CLX форму



{
  Capturing a CLX form is easy, once you know.
  It took me a little time to find out, so I'm giving the knowledge to help others :
}

type
  TFormCapturable = class(TForm)
  public
    procedure PrintOne;
  end;

var
  FormCapturable: TFormCapturable;

implementation

uses
  Qt;

procedure TFormCapturable.PrintOne;
var
  aBitmap: TBitmap;
  aWinHandle: QWidgetH;
  aWinId: Cardinal;
  x, y, w, h: integer;
begin
  // create a new bitmap to hold the captured screen
  aBitMap := TBitmap.Create;
  try
    // get a handle on the desktop
    aWinHandle := QApplication_desktop;
    // get the Id from the desktop handle
    aWinId := QWidget_winId(aWinHandle);
    // get the position and size of the windows
    x := Self.Left;
    y := Self.Top;
    w := Self.Width;
    h := Self.Height;
    // capture the window into the bitmap's pixmap
    QPixmap_grabWindow(aBitmap.Handle, aWinId, x, y, w, h);
    // save the bitmap
    aBitMap.SaveToFile('c:\temp\test.bmp');
  finally
    // don't forget to kill the bitmap after use.
    FreeAndNil(aBitMap);
  end;
end;




Похожие по теме исходники

Рисование математических формул




Copyright © 2004-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

Группа ВКонтакте