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

📄 h20000127-30.htm

📁 对于学习很有帮助
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<html><head><script language="JavaScript">	function reset(){   for ( var i=0; i < document.Form1.elements.length; i++ )     { document.Form1.elements[i].options[0].selected=true }}function going(url){        parent.location=url;        reset();}</script><style><!--A:link {text-decoration: none; color: #000000; font-family: 宋体}A:visited {text-decoration: none; color: #000000; font-family: 宋体}A:active {text-decoration: none; font-family: 宋体}A:hover {text-decoration: underline:#ffffff; color: #ff0000}body,table {font-size: 9pt; font-family: 宋体}.H1 {font-size: 9pt ; line-height:9pt; align=center}.ourfont {font-size: 9pt ; line-height:9pt; }.ourfont1 {font-size: 9pt ; line-height:9pt; }--></style><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>C++Builder 中大尺寸图象的显示技巧 </title></head><body topmargin="0" leftmargin="0"><div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" width="700"><tbody>  <tr>    <td><p class="content4"><span class="font"><img border="0" height="3" src="../../soft/pix.gif" width="700"></span></td>  </tr></tbody></table></center></div><div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" width="700"><tbody>  <tr>    <td bgColor="#3399ff" width="658"><p class="content4"><span class="font">&nbsp; </span><a style="text-decoration: none; color: rgb(255,255,255)" href="../os/H00705-2.htm">操作系统</a><font color="#FFFFFF"><span class="font"><span> |</span></span></font><a style="color: rgb(255,255,255); text-decoration: none" href="../image/H00705-14.htm">图像处理</a><font color="#FFFFFF"><span>|<span class="font"> </span></span></font><a style="color: rgb(255,255,255); text-decoration: none" href="../autoCAD/H00705-19.htm">辅助设计</a><span class="font"><font color="#FFFFFF"><span> | </span></font></span><a style="color: rgb(255,255,255); text-decoration: none" href="../data/H00705-18.htm">数     据 库</a><span class="font"><font color="#FFFFFF"><span> | </span></font></span><a style="color: rgb(255,255,255); text-decoration: none" href="H00706-1.htm">高级编程</a><span class="font"><font color="#FFFFFF"><span> | </span></font></span><a style="color: rgb(255,255,255); text-decoration: none" href="../netuse/H00705-20.htm">网络应用</a><font color="#FFFFFF"><span><span class="font"> | </span></span></font><a style="color: rgb(255,255,255); text-decoration: none" href="../webpage/H00705-21.htm">网页制作</a><font color="#FFFFFF"><span><span class="font"> |</span></span></font> <a style="color: rgb(255,255,255); text-decoration: none" href="../technic/H00706-3.htm">技术交流</a>     &nbsp; <font color="#000000"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     <a style="COLOR: rgb(255,255,255); TEXT-DECORATION: none" href="http://202.100.13.77/clslyb/default.asp?clsid=jiaoc">过客留言</a></strong></font></td>    <td bgColor="#3399ff" width="32"><p align="center" class="content4"><a href="http://202.100.13.77/clslyb/default.asp?clsid=jiaoc"><img src="../../soft/email.gif" alt="email.gif (493 字节)" border="0" WIDTH="20" HEIGHT="19"></a></td>  </tr></tbody></table></center></div><div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" width="700"><tbody>  <tr>    <td align="middle" bgColor="#3399ff" vAlign="top" width="130"></td>    <td vAlign="top" width="20"><p class="content4"><img src="../../soft/jiao2.gif" alt="jiao2.gif (176 字节)" WIDTH="14" HEIGHT="14"></td>    <td vAlign="top" width="550"><p class="content4" align="center"><span class="font"></span></td>  </tr></tbody></table></center></div><div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" width="700"><tbody>  <tr>    <td bgColor="#000000" height="1" width="130"><p class="content4"><span class="font"></span></td>    <td height="1" width="20"><p class="content4"><span class="font"></span></td>    <td bgColor="#000000" height="1" width="200"><p class="content4"><span class="font"></span></td>    <td bgColor="#000000" height="1" width="200"><p class="content4"><span class="font"></span></td>    <td height="1" width="10"><p class="content4"><span class="font"></span></td>    <td bgColor="#000000" height="1" width="140"><p class="content4"><span class="font"></span></td>  </tr>  <tr>    <td align="middle" bgColor="#3399FF" vAlign="top" width="130"><p class="content4" align="center"><span class="font"><br>    </span></p>    <p class="content4" align="center"><strong><a style="text-decoration: none; color: rgb(255,255,255)" href="../os/H00705-2.htm">操作系统</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="../image/H00705-14.htm">图像处理</a></strong><br>    <font color="#ff0000"><b><br>    </b></font><strong><a style="color: rgb(255,255,255); text-decoration: none" href="../autoCAD/H00705-19.htm">辅助设计</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="../data/H00705-18.htm">数 据 库</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="H00706-1.htm">高级编程</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="../netuse/H00705-20.htm">网络应用</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="../webpage/H00705-21.htm">网页制作</a></strong><br>    <br>    <strong><a style="color: rgb(255,255,255); text-decoration: none" href="../technic/H00706-3.htm">技术交流</a></strong></p>    <div align="center"><center><table border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody></tbody>    </table>    </center></div><table border="0" cellPadding="0" cellSpacing="0" width="100%"><tbody></tbody>    </table>    </td>    <td align="middle" vAlign="top" width="20"><p align="left" class="content4"><span class="font"><span><br>    </span></span></td>    <td colSpan="2" vAlign="top" width="400"> <font SIZE="2"><p align="center">C++Builder     中大尺寸图象的显示技巧 </p>    <p>罗 洁 才 </p>    <p>---- 在C++Builder 中 利 用TImage 控 件 可 以 轻 松 地 读 入 并 显 示     图 象, 但TImage 控 件 本 身 不 可 以 接 收 输 入 焦 点, 也 没 带     有 滚 动 条, 在 显 示 超 出 显 示 区 域 范 围 的 大 图 象 时, 需     要 对TImage 控 件 进 行 加 强。 本 文 提 出 两 种 最 容 易 实 现 且     有 效 的 方 法, 满 足 不 同 应 用 的 需 求。 </p>    <p>---- 方 法 一: 增 加 滚 动 条。 </p>    <p>---- 增 加 滚 动 条 可 以 通 过 将TImage 放 在TScrollBox 控 件 中 来     实 现。 步 骤 如 下: </p>    <p>---- (1)、 在 窗 体 中 放 置 一 个TScrollBox 控 件, 调 整 好 其     尺 寸。 </p>    <p>---- (2)、 设 置TScrollBox 控 件 的AutoScroll 属 性 为True。 </p>    <p>---- (3)、 在TScrollBox 控 件 是 放 置 一 个TImage 控 件。 </p>    <p>---- (4)、 设 置TImage 控 件 的 属 性:AutoSize 为True,Left 为0,Top     为0。 经 以 上 增 强 之 后, 如 果TImage 的 图 象 比 显 示 窗 口     大, 滚 动 条 会 自 动 出 现, 如 果 图 象 小 于 显 示 窗 口, 滚     动 条 自 动 消 失, 实 现 了 大 图 象 的 浏 览。 </p>    <p>---- 方 法 二: 图 象 漫 游。 </p>    <p>---- 图 象 漫 游 是 指 不 用 滚 动 条, 通 过 键 盘 或 者 鼠 标 控     制 图 象 的 移 动, 从 而 在 较 小 的 显 示 区 域 内 可 以 浏 览 图     象 的 任 何 部 分。 下 面 以 鼠 标 控 制 为 例 说 明。 </p>    <p>---- (1)、 在 窗 体 中 放 置 一 个TPanel 控 件, 调 整 好 其 尺     寸。 </p>    <p>---- (2)、 在TPanel 控 件 是 放 置 一 个TImage 控 件。 </p>    <p>---- (3)、 设 置TImage 控 件 的AutoSize 属 性 为True,Left 属 性 为0,Top     属 性 为0。 </p>    <p>---- (4)、 在TForm1 的 类 定 义 中 加 两 个 私 有 变 量: int iX0,iY0;     </p>    <p>---- (5)、 响 应TImage 控 件 的OnMouseDown 和OnMouseMove 事 件。 </p>    <p>void __fastcall TForm1::Image1MouseDown(TObject *Sender,</p>    <p>TMouseButton Button, TShiftState Shift, int X, int Y)</p>    <p>{</p>    <p>iX0 = X;</p>    <p>iY0 = Y;</p>    <p>}</p>    <p>void __fastcall TForm1::Image1MouseMove</p>    <p>(TObject *Sender, TShiftState Shift, int X, int Y)</p>    <p>{</p>    <p>int iDeltaX, iDeltaY;</p>    <p>if(Shift.Contains(ssLeft))</p>    <p>{</p>    <p>iDeltaX = X - iX0;</p>    <p>iDeltaY = Y- iY0;</p>    <p>if(iDeltaY)</p>    <p>Image1-&gt;Left += iDeltaX;</p>    <p>if(iDeltaY)</p>    <p>Image1-&gt;Top += iDeltaY;</p>    <p>}</p>    <p>}</p>    <p> </p>    <p>---- (6)、 运 行 时 按 住 鼠 标 左 键 拖 动, 图 象 将 跟 随 移     动。 </p>    <p>---- (7)、 如 果 通 过 键 盘 控 制, 只 需 参 考 鼠 标 控 制 的     代 码, 加 入 键 盘 控 制 即 可。 </p>    <p>---- (8)、 实 际 应 用 时, 根 据 需 要 加 入 边 界 限 制, 保     证 图 象 不 会 被 移 出 显 示 区 域 之 外。 </p>

⌨️ 快捷键说明

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