免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
Board logo

標題: 影像處理參考 [打印本頁]

作者: mhfo    時間: 2014-5-15 09:12     標題: 影像處理參考

假設有一Bitmap物件  

Dim mybmp as new Bitmap(  pic1.Image)  '圖片大小640*480

Dim mycolor(640,480) as Color

Dim x,y as Integer

for x=0 to 480

  for y=0 to 640

  mycolor(x,y)=mybmp.Getpixel(x,y)    '<---------------------取出顏色值

  next y

next x

感覺在VB6時代用GetPixel的速度還算很快,但到了.NET速度變慢許多,還是有其他方式

可以快速的分離出圖片中的RGB值的方式?







獲取載入圖形大小的方法。

哈,因為學藝不精,只會套用。


Public Function GetPictureBoxZoomSize(ByVal p_PictureBox As PictureBox) As Rectangle

        If p_PictureBox IsNot Nothing Then

            Dim _ImageRectanglePropert As System.Reflection.PropertyInfo = p_PictureBox.GetType.GetProperty("ImageRectangle", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)

            Return DirectCast(_ImageRectanglePropert.GetValue(p_PictureBox, Nothing), Rectangle)

        End If

End Function
----------------------------------------------------------------------




歡迎光臨 魚骨頭的雲端圖書館 (http://mhfo.hotbbs.info/) Powered by Discuz! 7.0.0