getpixel使用C ++的位图 [英] getpixel a bitmap with c++
本文介绍了getpixel使用C ++的位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我完全是一个初学者,我想从位图获取像素值..msdn并不能帮助我很多,帮助我如何获取图像,而不是从图像获取像素值.简单的代码...
谢谢..
I am totally beginner,,i''d like to get pixel value from a bitmap..msdn doesnt help me much, help me how to obtain an image, than get the pixel value from it..with c++ with a simple code...
Thanks..
推荐答案
使用类Bitmap
,构造函数/Save
方法进行文件读/写,使用GetPixel
/SetPixel
进行单个像素访问,LockBits
/Unlock
位用于访问整个像素阵列.
Use the classBitmap
, constructor/Save
method for file read/write,GetPixel
/SetPixel
for individual pixel access,LockBits
/Unlock
bits for accessing the whole array of pixels.
MSDN可以为您提供很多帮助,您只需要了解足够的知识即可.在C ++中,Get/SetPixel非常慢,而是创建DIBSECTION,您将可以快速访问基础像素数据.
MSDN helps you plenty, you just need to know enough to understand it. Get/SetPixel is very slow in C++, create a DIBSECTION instead, and you''ll have fast access to the underlying pixel data.
这篇关于getpixel使用C ++的位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文