如何加载12位图像到System.Drawing.Bitmap? [英] How to load 12 bit image into System.Drawing.Bitmap?

查看:324
本文介绍了如何加载12位图像到System.Drawing.Bitmap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台服务器提供12位的图像,我可以通过HTTP访问图像,但由于它是12位图像我不能加载到System.Drawing.Bitmap(流流)。

I have a server serving 12bit image and I can access the image through http, but since it is 12 bit image I am not able to load into System.Drawing.Bitmap(Stream stream).

图像格式PNG位深度12

Image format PNG bit depth 12

图像是这里原来的12位有一个

Image is here original 12 bit one

这是形象应该如何看,一旦你能够加载。

This is how the image should look once you are able to Load.

推荐答案

根据MSDN W3C PNG格式都支持的链接,和W3C定义每像素4位的PNG(12位合计为RGB我猜它结束了)的链接。同时,我没有看到在的PixelFormat 链接但我想(如果支持的话),它被转换为24位或其他。

According to MSDN W3C PNG formats are supported link, and W3C that defines 4 bits per pixel for PNG (which ends up 12 bits total for RGB I guess) link. At the same time I don't see 12 bits in the PixelFormat link but I guess it is converted to 24bit or other (if supported).


  1. 仔细检查,如果该图像确实是png格式。很少图像文件有错误的文件扩展名。它可以是一个JPEG或别的东西。

  2. 显示我们code你如何加载该文件。有时可以有技巧,如流被关闭前,你真正尝试 FromStream 了。

  1. Double check if the image is really png. Rarely image files have wrong file extensions. It can be a jpeg or something else.
  2. Show us the code how you load the file. Sometimes there can be tricks, like the Stream is closed before you actually try FromStream it.

这篇关于如何加载12位图像到System.Drawing.Bitmap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆