自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

WPF導(dǎo)出圖片具體方式介紹

開(kāi)發(fā) 開(kāi)發(fā)工具
對(duì)于初學(xué)者來(lái)說(shuō),掌握一些WPF的基礎(chǔ)技術(shù)運(yùn)用是非常有必要的。那么,對(duì)于WPF導(dǎo)出圖片這一基礎(chǔ)技能的掌握需要我們?cè)趯?shí)踐中去不斷的鞏固。

當(dāng)我們?cè)谑褂?a >WPF的時(shí)候,如何正確的進(jìn)行圖片的導(dǎo)出是一個(gè)比較重要的基本技術(shù)。在這里我們將會(huì)學(xué)到WPF導(dǎo)出圖片的相關(guān)代碼編寫(xiě)方式。#t#

WPF導(dǎo)出圖片代碼示例:

  1. private void SaveToImage
    (FrameworkElement p_Framework
    Element,string p_FileName)  
  2. {  
  3. System.IO.FileStream fs = new 
    System.IO.FileStream(p_FileName, 
    System.IO.FileMode.Create);  
  4. RenderTargetBitmap bmp = new 
    RenderTargetBitmap((int)p_
    FrameworkElement.ActualWidth, 
    (int)p_FrameworkElement.ActualHeight, 
    1 / 96, 1 / 96, PixelFormats.Default);  
  5. bmp.Render(p_FrameworkElement);  
  6. BitmapEncoder encoder = 
    new TiffBitmapEncoder();  
  7. encoder.Frames.Add
    (BitmapFrame.Create(bmp));  
  8. encoder.Save(fs);  
  9. fs.Close();  

希望大家通過(guò)上面這段WPF導(dǎo)出圖片的方式能夠充分掌握這一技術(shù)要點(diǎn)。

責(zé)任編輯:曹凱 來(lái)源: 博客園
相關(guān)推薦

2009-12-28 13:11:35

WPF音頻

2009-12-29 10:32:24

WPF Listbox

2009-12-28 16:37:46

WPF異步模式

2009-12-29 18:02:26

SilverLight

2010-01-04 16:06:34

Silverlight

2009-11-27 13:14:07

PHP函數(shù)strist

2009-11-24 14:45:08

PHP批量上傳圖片

2010-02-22 15:13:04

WCF分布式事務(wù)

2010-01-27 16:30:47

Android選項(xiàng)卡

2009-12-28 16:54:30

WPF注釋

2009-12-28 10:47:58

WPF繪圖

2009-12-24 15:36:41

WPF邏輯樹(shù)

2009-12-24 10:09:33

WPF事件注冊(cè)

2009-12-24 14:18:57

WPF類型轉(zhuǎn)換

2009-12-25 11:04:51

WPF Border

2009-12-23 18:06:25

WPF模板

2009-12-25 10:05:06

WPF資源

2009-12-29 13:29:28

WPF Depende

2009-12-28 13:57:39

WPF文字

2009-12-29 14:20:27

WPF路徑
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)