读入图片...获取ascii值 [英] Read in image ... get ascii values

查看:84
本文介绍了读入图片...获取ascii值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读取一个图像文件(bmp,jpeg,...),这样我就可以保留它的ascii /二进制值,并改变图像。我怎么能用C ++做这个(我正在使用Visual Studio,各种版本)。


所以基本上,我想制作数组中的一个大矩阵值。


我知道这可以使用十六进制编辑器完成,但在C ++中我不知道如何获得ascii值。感谢任何帮助。

I want to read in an image file ( bmp, jpeg, ... ) so I can retain it''s ascii / binary values, and alter the image. How can I do this in C++ ( I''m using Visual Studio, various versions ).


so basically, I want to make a big matrix of values in an array.


I know this can be done using a hex editor, but in C++ I''m not sure how to get the ascii values. Any help is appreciated.

推荐答案



我不太明白这个问题。你正试图将一个文件读入一个数组,所以你可以制作一个字符数组并读入它吗?二进制和ASCII值将被保留,对吗?我不知道你需要用ASCII值做什么。
Hi,
I don''t quite understand this question. You''re trying to read a file into an array, so can you just make an array of chars and read into that? The binary and ASCII values would be retained, right? I don''t see what you need to do with ASCII values.


我想得到实际值的原因是因为在我的代码中我希望能够改变颜色图像(通过更改ascii值)并使用我的更改输出该图像。
The reason I want to get the actual values is because in my code I want to be able to change the color of the image (by changing the ascii values) and output that image with my changes.


chars存储放入其中的字符的ASCII值。如果您将文件读入一个字符数组,那么您将获得文件中所有字符的ASCII值,并且您可以使用它们就像它们是整数一样。
chars store the ASCII values of the characters you put into them. If you read the file into an array of chars, then you will have the ASCII values of all the characters in the file, and you can work with them just as if they were ints.


这篇关于读入图片...获取ascii值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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