将图像从图片框以二进制格式保存到硬盘 [英] Save a Image from a picturebox to harddisk in binary format

查看:72
本文介绍了将图像从图片框以二进制格式保存到硬盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用二进制格式(1bpp)将图像保存在图片框中,但VB.net不支持这个。我该怎么办?请帮我编码。

I want to save an image in picturebox with binary format(1bpp) but VB.net doesn''t support this. What do I do? Please help me in coding this.

If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
    ptr2.Image.Save(SaveFileDialog1.FileName)
    mnuclose.Enabled = True
End If

推荐答案

二进制图像格式与1bpp(每像素一位)无关 - 所有格式都是二进制!你只是感到困惑。



如果你真的需要每像素一位,问题就没有完全定义,因为这是数据丢失的操作,所以它如果您同意放弃信息,或者将像素分为100%白色或100%黑色的标准,应该定义哪个部分。



这不是一件小事任务。其中一个可能的含义是将分色分为两种音调。低质量的解决方案是通过某些标准将像素区分为亮度,因此可以存在许多不同的解决方案(取决于所选的级别)。高质量的解决方案实际上是与图像识别相关的复杂任务。您需要学习一些图像识别的基础知识才能理解这一点。图像识别是科学的一个完整分支。



-SA
Binary image format has nothing to do with "1bpp" (one bit per pixel) — all formats a binary! You''re just confused.

If you really need one bit per pixel, the problem is not fully defined, as this is the operation with data loss, so it should be defined what part if information you agree to loose or what are the criteria to classify a pixel into 100% white or 100% black.

This is not a trivial task. One possible meaning of it would be the "posterization" into two tones. A low-quality solution is discrimination of the pixel by some criteria as "brightness", so there can be many different solution (depending on selected level). A high-quality solution is really a complex task related to image recognition. You need to learn some basics of image recognition to understand this. Image recognition is a whole branch of science.

—SA


这篇关于将图像从图片框以二进制格式保存到硬盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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