"Unit1.cpp" Dosyası

#include <vcl\vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma resource "*.dfm"
TForm1 *Form1;
//-------------------------------------------------------------------------



//-------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner):TForm(Owner)
{
}
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
static HFONT hFont;
static LOGFONT lf;
char Yazi[] = "APİ KULLANARAK FONT YARATMA VE YAZDIRMA";

lf.lfHeight = 25;
lf.lfWeight = FW_NORMAL;
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfCharSet = TURKISH_CHARSET;
lf.lfPitchAndFamily = 34;

hFont = CreateFontIndirect(&lf);
::SelectObject(Form1->Canvas->Handle, hFont);

::SetBkMode(Form1->Canvas->Handle, TRANSPARENT);
::TextOut(Form1->Canvas->Handle, 60, 100, Yazi, strlen(Yazi));
::DeleteObject(hFont);

}
//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
static HFONT hFont;
static LOGFONT lf;
char Yazi[] = "DÜŞEY YAZI";

lf.lfHeight = 25;
lf.lfWeight = FW_NORMAL;
lf.lfEscapement = 900;
lf.lfOrientation = 0;
lf.lfCharSet = TURKISH_CHARSET;
lf.lfPitchAndFamily = 34;

hFont = CreateFontIndirect(&lf);
::SelectObject(Form1->Canvas->Handle, hFont);

::SetBkMode(Form1->Canvas->Handle, TRANSPARENT);
::TextOut(Form1->Canvas->Handle, 300, 175, Yazi, strlen(Yazi));
::DeleteObject(hFont);
}
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
static HFONT hFont;
static LOGFONT lf;
char Yazi[] = "AÇILI YAZI";

lf.lfHeight = 25;
lf.lfWeight = FW_NORMAL;
lf.lfEscapement = 450;
lf.lfOrientation = 0;
lf.lfCharSet = TURKISH_CHARSET;
lf.lfPitchAndFamily = 34;

HDC hdc = Form1->Canvas->Handle;
hFont = CreateFontIndirect(&lf);

::SelectObject(hdc, hFont);
::SetBkMode(hdc, TRANSPARENT);
::TextOut(hdc, 265, 145, Yazi, strlen(Yazi));
::DeleteObject(hFont);

}

//-------------------------------------------------------------------------


//-------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
Close();
}
//-------------------------------------------------------------------------

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////

"Unit1.h" Dosyası

//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include <vcl\ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TButton *Button2;
TButton *Button3;
TButton *Button4;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button4Click(TObject *Sender);

private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////

PROGRAMIN EKRAN GÖRÜNTÜSÜ

<<< Geri Dön