Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
源码类别:

VC书籍

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit1.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. //---------------------------------------------------------------------------
  10. __fastcall TForm1::TForm1(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TForm1::Button1Click(TObject *Sender)
  16. {
  17.   switch(RadioGroup1->ItemIndex)
  18.   {
  19.     case 1:
  20.       Canvas->Font->PixelsPerInch=96;
  21.       break;
  22.     case 2:
  23.       Canvas->Font->PixelsPerInch=180;
  24.       break;
  25.     case 3:
  26.       Canvas->Font->PixelsPerInch=360;
  27.       break;
  28.     case 4:
  29.       Canvas->Font->PixelsPerInch=720;
  30.       break;
  31.     case 5:
  32.       Canvas->Font->PixelsPerInch=1440;
  33.       break;
  34.     default:
  35.       Canvas->Font->PixelsPerInch=48;
  36.       break;
  37.   }
  38.   Canvas->Font->Size=12;
  39.   Canvas->TextOut(220,20,"中华人民共和国");
  40. }
  41. //---------------------------------------------------------------------------