原創(chuàng)|使用教程|編輯:郝浩|2013-09-16 10:55:28.000|閱讀 531 次
概述:ImageGear for .NET提供了目前最先進(jìn)的用于創(chuàng)建、控制、更加安全、高質(zhì)量的成像應(yīng)用程序。本文將講解如何使用ImageGear for .NET創(chuàng)建一個簡單的C# WPF應(yīng)用程序,這個應(yīng)用程序?qū)?shí)現(xiàn)加載、顯示、保存圖像的功能。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
在前面的《圖像處理控件ImageGear for .NET教程: C# WPF應(yīng)用程序創(chuàng)建示例(2)》一文中已經(jīng)講解了如何在中已經(jīng)介紹了開發(fā)應(yīng)用程序的五個步驟,本文將完成開發(fā)應(yīng)用程序的步驟。
六、在去的放大菜單項(xiàng)目而創(chuàng)建的處理程序中,添加的代碼到程序中。
if (null != imGearPageDisplay && !imGearPageDisplay.Page.DIB.IsEmpty()) { // Get the current zoom info ImGearZoomInfo igZoomInfo = imGearPageDisplay.GetZoomInfo(imGearPageView1); // Increase the zoom igZoomInfo.Horizontal.Value = igZoomInfo.Horizontal.Value * 1.25; igZoomInfo.Vertical.Value = igZoomInfo.Vertical.Value * 1.25; igZoomInfo.Horizontal.Fixed = true; igZoomInfo.Vertical.Fixed = true; // Set the new zoom values and repaint the view imGearPageDisplay.UpdateZoomFrom(igZoomInfo); imGearPageView1.Invalidate(); }
七、添加下面的代碼到縮小單擊處理程序。
if (null != imGearPageDisplay && !imGearPageDisplay.Page.DIB.IsEmpty()) { // Get the current zoom info ImGearZoomInfo igZoomInfo = imGearPageDisplay.GetZoomInfo(imGearPageView1); igZoomInfo.Horizontal.Value = igZoomInfo.Horizontal.Value * (1/1.25); igZoomInfo.Vertical.Value = igZoomInfo.Vertical.Value * (1/1.25); igZoomInfo.Horizontal.Fixed = true; igZoomInfo.Vertical.Fixed = true; // Set the new zoom values and repaint the view imGearPageDisplay.UpdateZoomFrom(igZoomInfo); imGearPageView1.Invalidate(); }
八、在Rotate 90點(diǎn)擊處理應(yīng)用程序中添加下面的代碼。
if (null != imGearPageDisplay && null != imGearPage && !imGearPageDisplay.Page.DIB.IsEmpty()) try { ImGearProcessing.Rotate(imGearPage, ImGearRotationValues.VALUE_90); imGearPageView1.Invalidate(); } catch (ImGearException ex) { Debug.WriteLine(ex.Message); }
九、對于Rotate 180以及Rotate 270菜單項(xiàng)目的點(diǎn)擊處理應(yīng)用程序和上面的是一樣的,除了量旋轉(zhuǎn)分別是GearRotationValues.VALUE_180以及ImGearRotationValues.VALUE_270。
十、最后,點(diǎn)擊“退出”菜單項(xiàng)的代碼,如下所示:
this.Close();
十一、現(xiàn)在可以編譯和運(yùn)行完成的應(yīng)用程序了。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件