⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dpi13.htm

📁 delphi 教程 Delphi 6 常见的大部分函数的使用方法及使用例子
💻 HTM
字号:
<html>
<head>
<title>贴上精致的壁纸</title>
 
 
 
 
 
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
 
 
</head>
<p align="center"><script src="../../1.js"></script></a>

<body bgcolor="#ffffff" leftmargin="5" topmargin="1" marginheight="5" marginwidth="5">
<div align=center> 
  <table border=0 cellpadding=0 cellspacing=0 width=680 align="center">
    <tbody> 
    <tr> 
       
    </tr>
    </tbody> 
  </table>
  <table border=0 bordercolordark=#66aaff bordercolorlight=#66aaff cellpadding=0 
cellspacing=0 width=680 align="center" height="128">
    <tbody> 
    <tr> 
      <td bgcolor=#F9D23C height=14> 
        <div align=center class=H1> <big>贴上精致的壁纸</big> </font></b></font></b></font></div>
      </td>
    </tr>
    <tr valign=top> 
      <td class=H1 height=236> 
        <p align="center">&nbsp;</p>
        <p>&nbsp;&nbsp;&nbsp; 在网上,几乎每个主页的壁纸都具有鲜明的特色,或是木纹,或是玛瑙色大理石纹,或是浅色的文字等等,令人赏心悦目。我们在设计Delphi应用程序时,也不妨借鉴借鉴,利用TImage对象以及窗体的画布(Canvas)对象,给程序的主窗口设计一幅精致有趣的壁纸,以增强应用程序的感染力。<br>
          &nbsp;&nbsp;&nbsp; 1、利用PhotoShop等图像处理软件,充分展示你的想象能力,制作一幅底纹图像,或者在网上抓一个。如果你制作的图像的颜色数设置得很高,例如16位真彩色,就需要相应设置Win95中显示器的调色板参数,为了让你的程序能适应不同的计算机环境,建议图像尺寸和图像的颜色数不要设置得太大。<br>
          &nbsp;&nbsp;&nbsp; 2、新建一个工程,打开程序的代码编辑窗口,在Var部分加入以下说明:<br>
          &nbsp;&nbsp;&nbsp; TileImage:TImage; //定义一个TImage对象<br>
          &nbsp;&nbsp;&nbsp; 3、编写Form1.OnCreate事件代码:<br>
          &nbsp;&nbsp;&nbsp; procedure TForm1.FormCreate(Sender: TObject);<br>
          &nbsp;&nbsp;&nbsp; begin<br>
          &nbsp;&nbsp;&nbsp; //创建一个TImage对象,并载入指定底纹位图文件<br>
          &nbsp;&nbsp;&nbsp; TileImage:=TImage.Create(Self);<br>
          &nbsp;&nbsp;&nbsp; TileImage.Picture.LoadFromFile('bg_green.bmp');<br>
          &nbsp;&nbsp;&nbsp; end;<br>
          &nbsp;&nbsp;&nbsp; 4、编写Form1.OnPaint事件代码:<br>
          &nbsp;&nbsp;&nbsp; procedure TForm1.FormPaint(Sender: TObject);<br>
          &nbsp;&nbsp;&nbsp; var<br>
          &nbsp;&nbsp;&nbsp; PWidth,PHeight,X,Y: Integer;<br>
          &nbsp;&nbsp;&nbsp; begin<br>
          &nbsp;&nbsp;&nbsp; //壁纸图片的宽,高<br>
          &nbsp;&nbsp;&nbsp; PWidth := TileImage.Picture.Bitmap.Width;<br>
          &nbsp;&nbsp;&nbsp; PHeight := TileImage.Picture.Bitmap.Height;<br>
          &nbsp;&nbsp;&nbsp; X := 0;<br>
          &nbsp;&nbsp;&nbsp; while X &lt; Form1.Width do begin<br>
          &nbsp;&nbsp;&nbsp; Y := 0;<br>
          &nbsp;&nbsp;&nbsp; while Y &lt; Form1.Height do begin<br>
          &nbsp;&nbsp;&nbsp; Form1.Canvas.Draw(X, Y, TileImage.Picture.Bitmap);<br>
          &nbsp;&nbsp;&nbsp; Y := Y + PHeight;<br>
          &nbsp;&nbsp;&nbsp; end;<br>
          &nbsp;&nbsp;&nbsp; X := X + PWidth;<br>
          &nbsp;&nbsp;&nbsp; end;<br>
          &nbsp;&nbsp;&nbsp; end;<br>
          &nbsp;&nbsp;&nbsp; 5、加入应用程序的其他对象,并编写相应代码。<br>
          &nbsp;&nbsp;&nbsp; 6、编译、运行程序,试着改变窗口的大小。<br>
          &nbsp;&nbsp;&nbsp; 7、本程序在Pwin95、Delphi3环境下调试通过。
        <p align="center"><font 
      color=#ffa000><b><br>
          </b><b>                                            
      </td>
    </tr>
    </tbody> 
  </table>
</div>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -