图像处理控件ImageGear for .NET教程:C# WPF应用程序创建示例(2)
?
开发应用程序?
一、首先,添加必要的using语句
?
通过右键单击窗口打开窗口代码,选择查看代码。在代码的最上面,添加下面的语句。private void loadPageToolStripMenuItem_Click(object sender, EventArgs e){ OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = ImGearFileFormats.GetSavingFilter(ImGearSavingFormats.UNKNOWN); if (DialogResult.OK == openFileDialog1.ShowDialog()) { using (FileStream stream = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { try { // Load the image into the page imGearPage = ImGearFileFormats.LoadPage(stream, 0); } catch (ImGearException ex) { Debug.WriteLine(ex.Message); } } if (null != imGearPage && null != imGearPage.DIB && !imGearPage.DIB.IsEmpty()) { // create a new page display imGearPageDisplay = new ImGearPageDisplay(imGearPage); // associate the page display with the page view imGearPageView1.Display = imGearPageDisplay; // cause the page view to repaint imGearPageView1.Invalidate(); } }}
?开发应用程序的其他步骤以后再补上哈~~就到这里先