11
A
回答
20
Bitmap類從System.Drawing.dll程序組件:
Bitmap bitmap = new Bitmap(@"C:\image.png");
Color clr = bitmap.GetPixel(0, 0);
1
當然我已經搜索了並且找到了PngBitmapDecoder類,但它似乎在.Net 2.0中不可用?
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.pngbitmapdecoder.aspx
上面的鏈接提到它在PresentationCore組件,我似乎並沒有把包括與.net 2.0
1
那麼,位圖類可以讀取PNG文件並訪問像素。它可以看到透明的像素? PNG支持透明,而BMP不支持。但是,它仍然有效。
Bitmap bitmap = new Bitmap("icn_loading_animated3a.png");
pictureBox1.Image = bitmap;
Color pixel5by10 = bitmap.GetPixel(5, 10);
上面的代碼讀取我的小圖片,然後讀取透明像素。顏色類別具有RGBA值,並且我讀取的像素被識別爲透明。
相關問題
- 1. 用gil讀取png圖像
- 2. 從.plist文件中提取.png圖像
- 3. 從.NET中的圖像文件中讀取像素數據
- 4. 如何手動讀取PNG圖像文件並在C#中操作像素?
- 5. 在.NET中讀取Canon CR2原始圖像文件
- 6. VB2013:使用.NET 2.0時從文本文件中讀取
- 7. 讀取不失真的灰度PNG圖像文件
- 8. 如何使用libpng讀取png圖像?
- 9. 在HTML文件中加載PNG圖像
- 10. 從管道讀取一個PNG圖像
- 11. 錯誤而讀取PNG圖像尺寸
- 12. 讀取圖像文件
- 13. 讀取文件在c#.net
- 14. 從流中讀取PNG文件
- 15. 讀取.dat圖像文件
- 16. 在.NET中提取關於PNG的圖像信息
- 17. 在C中讀取PGM圖像(沒有正確讀取文件)
- 18. .Net 2.0中的IronPython XML讀取器
- 19. .NET中的Png圖像處理
- 20. 從XML文件中讀取圖像
- 21. VHDL textio,從文件中讀取圖像
- 22. 從MATLAB中的文件讀取圖像
- 23. 從C++文件中讀取圖像
- 24. 如何在.NET中讀取EMF文件?
- 25. 如何在.Net中讀取.ETL文件?
- 26. 在.NET項目中讀取文件
- 27. 如何將8位PNG圖像作爲8位PNG圖像讀取?
- 28. 讀.png文件逐像素使用boost.gil
- 29. 在python3.6中,opencv imread無法讀取「png」圖像
- 30. 在緩衝區中讀取一個PNG圖像
不,這是一個WPF程序集(.Net 3.0+) – Lucas 2009-02-19 20:40:31