在 .Net 中  將 原有的 bitmap 影像 轉入 康內視

 

方法一:運用記憶體指標

Dim bm As Bitmap = Bitmap.FromFile("Z:\D\temp2.tiff")

Dim bmdata As BitmapData = bm.LockBits(New Rectangle(0, 0, bm.Width, bm.Height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed)
     
Dim cogRoot As New CogImage8Root

Dim SID As System.IDisposable = Nothing

cogRoot.Initialize(bm.Width, bm.Height, bmdata.Scan0, bmdata.Stride, SID)

bm.UnlockBits(bmdata)

 

 

方法二:直接將bitmap 輸入

Dim bm As Bitmap = Bitmap.FromFile("Z:\D\temp2.tiff")  

Dim im As New CogImage8Grey(bm)
CogDisplay1.Image = im

文章標籤
全站熱搜
創作者介紹
創作者 Rh 的頭像
Rh

程式狂想曲

Rh 發表在 痞客邦 留言(0) 人氣(652)