Unit Unitl;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls,
Forms, Dialogs, MPlayer, StdCtrls, ExtCtrls;
Type
TForml = class(TForm)
Labell: TLabel;
Panell: TPanel;
Buttonl: TButton;
MediaPlayerl: TMediaPlayer;
procedure ButtonlClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations ) public
{ Public declarations } end;
Var
Forml: TForml ;
implementation
{$R *.DFM}
Procedure TForml.ButtonlClick(Sender: TObject);
Begin
MediaPlayer1. Play;
end;
procedure TForml.FormCreate(Sender: TObject);
begin
MediaPlayer1. DisplayRect:=Rect(0,0,60,60);
end;
end.
5.4 Bosmaga chiqarish
Matnli rejim
Agar printerda biror matn bosmaga chiqarilishi lozim bolsa.
AssignFile o‘rniga AssignPrn protsedurasini chaqirish lozim:
procedure TForml.ButtonlClick(Sender: TObject);
var
To Pm : TextFile;
begin
AssignPm(To_Pm);
Rewrite(ToPm);
Writeln(To_Prn, 'Printer in Text Mode');
CloseFile(ToPm);
end;
Delphi tilida System modulidagi ba’zi funksiya va o‘zgaruvchilar
nomlari o‘zgartirilgan:
Grafikrejim(TPrinter obyekti)
Grafik rejimda bosmaga chiqarish uchun formaning Print usulini
qollash mumkin. Lekin maxsus Printer obyektidan (TPrinter sinfiga
tegishli) foydalanish qulayroqdir. Bu obyektdan foydalanish uchun
Printers modulini dasturga qo‘shish ya’ni uses bolimida e’lon qilish
lozim. Printer obyekti Canvas xossasidan foydalanishga imkon beradi.
Dostları ilə paylaş: |