WorldWind学习系列 3:功能分析——截屏功能和 有关 窗体分析来源: 发布时间:星期五, 2009年12月11日 浏览:157次 评论:0
WorldWind.cs中截屏功能分析:
private void menuItemSaveScreenShot_Click(object sender, ![]() ![]() ![]() ![]() 主要是弹出SaveFileDialog ![]() ![]() this.worldWindow.SaveScreenshot(dlg.FileName);// ![]() ![]() ![]() ![]() ![]() ![]() WorldWindow.cs真正 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() SaveScreenShot ![]() ![]() ![]() ![]() ![]() { try { using( Surface backbuffer = m_Device3d.GetBackBuffer(0, 0, BackBufferType.Mono) ) SurfaceLoader.Save(saveScreenShotFilePath, saveScreenShotImageFileFormat, backbuffer); saveScreenShotFilePath = null; } catch(InvalidCallException caught) { MessageBox.Show(caught.Message, "Screenshot save failed.", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } 实现关键: WorldWindow.cs中添加 using Microsoft.DirectX.Direct3D; using Microsoft.DirectX; 这里 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 该截屏方式大家可以学习借鉴 ![]() ![]() “有关窗体”:AboutDialog.cs分析 1、 从文件中加载图片 this.pictureBox.Image = Splash.GetStartupImage ![]() public ![]() ![]() { ![]() } 2.获取弹出窗体 ![]() ![]() ![]() ![]() ![]() private void pictureBox_Click(object sender, ![]() { MainApplication ![]() ![]() ![]() ![]() ![]() ![]() //MainApplication.BrowseTo( MainApplication.WebsiteUrl ); } 3.通过进程跳转到网页地址 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() { ProcessStartInfo psi = ![]() ![]() psi.FileName = url; psi.Verb = "open"; psi.UseShellExecute = true; psi.CreateNoWindow = true; Process.Start(psi); } 简单地使用IE打开网络地址:Process.Start("iexplore.exe","http://www.163.com"); 4.重载了Form窗体 ![]() ![]() ![]() ![]() ![]() protected override void _disibledevent=> ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() { Close ![]() e.Handled = true; //表示事件已响应 } ![]() } base.OnKeyUp(e); } 0
相关文章读者评论发表评论 |