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

•  DeLiKaTeS Tetris (Тетрис)  136

•  TDictionary Custom Sort  3 318

•  Fast Watermark Sources  3 065

•  3D Designer  4 825

•  Sik Screen Capture  3 321

•  Patch Maker  3 536

•  Айболит (remote control)  3 637

•  ListBox Drag & Drop  2 996

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

•  Графические эффекты  3 927

•  Рисование по маске  3 232

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

•  Canvas Drawing  2 735

•  Рисование Луны  2 561

•  Поворот изображения  2 166

•  Рисование стержней  2 161

•  Paint on Shape  1 564

•  Генератор кроссвордов  2 226

•  Головоломка Paletto  1 764

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

•  Пазл Numbrix  1 682

•  Заборы и коммивояжеры  2 052

•  Игра HIP  1 279

•  Игра Go (Го)  1 225

•  Симулятор лифта  1 471

•  Программа укладки плитки  1 214

•  Генератор лабиринта  1 542

•  Проверка числового ввода  1 352

•  HEX View  1 490

•  Физический маятник  1 355

 
скрыть


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

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



Delphi Sources

Использование PASSTHROUGH для отправки данных прямо на принтер



Оформил: DeeCo

{ 
  By using the Windows API Escape() function, 
  your application can pass data directly to the printer. 
  If the printer driver supports the PASSTHROUGH printer escape, 
  you can use the Escape() function and the PASSTHROUGH printer escape 
  to send native printer language codes to the printer driver. 
  If the printer driver does not support the PASSTHROUGH printer escape, 
  you must use the DeviceCapabilities() and ExtDevMode() functions instead. 


  Mit der Windows API Funktion Escape() kann man Daten direkt zum Drucker schicken. 
  Wenn der Drucker Treiber dies nicht unterstutzt, mussen die DeviceCapabilities() 
  und ExtDevMode() Funktionen verwendet werden. 
}

 //  DOS like printing using Passthrough command 
// you should use "printer.begindoc" and "printer.enddoc" 

type
   TPrnBuffRec = record
   bufflength: Word;
   Buff_1: array[0..255] of Char;
 end;

 function DirectToPrinter(S: string; NextLine: Boolean): Boolean;
 var
    Buff: TPrnBuffRec;
   TestInt: Integer;
 begin
   TestInt := PassThrough;
   if Escape(Printer.Handle, QUERYESCSUPPORT, SizeOf(TESTINT), @testint, nil) > 0 then
   begin
     if NextLine then  S := S + #13 + #10;
     StrPCopy(Buff.Buff_1, S);
     Buff.bufflength := StrLen(Buff.Buff_1);
     Escape(Printer.Canvas.Handle, Passthrough, 0, @buff, nil);
     Result := True;
   end
   else
     Result := False;
 end;

 // this code works if the printer supports escape commands 
// you can get special esc codes from printer's manual 

//  example: 
printer.BeginDoc;
 try
   directoprinter('This text ');
 finally
   printer.EndDoc;
 end;




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

Нейросеть для распознавания образов

Механизм станка качалки для нефти

Весы для взвешивания

Кувшины для воды

 

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

Экспорт баз данных в Excel

База данных "Книжный магазин"

База данных Видеофильмов

 

База данных "Школа"

База данных без BDE

База данных студентов

Фильтрование данных

 

Pevrica (сжатие данных)

Работа с принтером




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

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