📄 135.htm
字号:
<!-- saved from url=(0022)http://internet.e-mail -->
<html>
<head>
<title>使MDI窗口有一个背景图象或使它平铺 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="195434" alink="195434">
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="621"><a href="http://www.CoDelphi.com"><img src="images/logo.gif" border="0" width="153" height="60"><img src="images/bigbanner.gif" border="0" width="468" height="60"></a></td>
</tr>
</table><br>
<br>
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left" valign="top" class="font9" height="155">
<div align="center" class="btitle">使MDI窗口有一个背景图象或使它平铺 <br>
<br>
</div>
<div align="center"><strong>CoDelphi.com </strong></div>
<b><br>
摘 要</b>:我怎样使我的MDI窗口有一个背景图象或使它平铺? <br>
<b> 关键字</b>:多文档界面 背景 图象 平铺 <br>
<b> 类 别</b>:用户界面
<hr size="1" width="100%">
<span class="content">    确定你已在在你的主窗体对象中加入了下面的变量: <br>      FClientInstance : TFarProc; <br>      FPrevClientProc : TFarProc; <br><br><br>{ MDI的背景代码 } <br>procedure TMainForm.ClientWndProc(var Message: TMessage); <br>var <br>  Dc : hDC; <br>  Row : Integer; <br>  Col : Integer; <br>begin <br>  with Message do <br>    case Msg of <br>      WM_ERASEBKGND: <br>      begin <br>        Dc := TWMEraseBkGnd(Message).Dc; <br>        // 在DC上平铺图象 <br>        for Row := 0 to ClientHeight div Image1.Picture.Height do <br>          for Col := 0 to ClientWidth div Image1.Picture.Width do <br>            BitBlt(Dc, <br>               Col * Image1.Picture.Width, <br>               Row * Image1.Picture.Height, <br>               Image1.Picture.Width, <br>               Image1.Picture.Height, <br>               Image1.Picture.Bitmap.Canvas.Handle, <br>               0, <br>               0, <br>               SRCCOPY); <br>          Result := 1; <br>      end; <br>      else // 传递其他消息<br>        Result := CallWindowProc(FPrevClientProc, <br>                                 ClientHandle, <br>                                 Msg, <br>                                 wParam, <br>                                 lParam); <br>  end; <br>end; <br><br><br><br>- 在你的主窗体的OnShow事件中加入以下代码: <br><br>  // MDI背景平铺代码,与WndProc链接 <br>    FClientInstance := MakeObjectInstance(ClientWndProc); <br>    FPrevClientProc := Pointer(GetWindowLong(ClientHandle,GWL_WNDPROC)); <br>    SetWindowLong(ClientHandle,GWL_WNDPROC,LongInt(FClientInstance)); <br><br>- 现在你有一个背景了! <br><br> <br><br></span>
<table border="0" cellspacing="0" cellpadding="1" class="font9" align="center" width="100%">
<tr align="left" valign="middle" bgcolor="195434">
<td height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#C9C9C6" height="2"></td>
</tr>
</table>
<div align="center"><br>
中文开发在线<a href="http://www.codelphi.com" target="_blank">www.codelphi.com</a>授权使用。
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -