图像中的像素编辑 [英] pixel editing in an image

查看:75
本文介绍了图像中的像素编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找VB的getpixel/setpixel函数的C ++版本.我在VB中有一个程序,它的运行速度太慢了,所以我试图将其转换为VC ++.基本上,它运行的算法会逐像素编辑图像.它在VB中工作正常,但像泥浆一样慢.

因此,a)如何在Vc ++中访问已加载图像中选定像素的rbg值,b)一旦获得信息,如何更改它们?

在此先感谢您.

I''m looking for the C++ version of the getpixel/setpixel functions of VB. I have a program in VB that''s way too slow, so I''m trying to translate it into VC++. Basically it runs algorithms that edit an image pixel by pixel. It works fine in VB, but slow as mud.

So a) how do you access the rbg values of a selected pixel in a loaded image in Vc++, and b) how do you change them once you have the info?

Thanks in advance.

推荐答案

您要访问多少像素? 5 15 :-)

如果要处理整个图片或其中的很大一部分,请忘记GetPixel/SetPixel-这太慢了.
若要获得更好的方法,请查看此CodeProject文章:一种在不使用慢GetPixel的情况下处理Windows位图像素数据的快速方法和SetPixel方法 [ ^ ].

另请参阅另一篇文章-教程:位图基础知识-GDI教程 [
How many pixels you want to access? 5, 15? :-)

If you want to process a whole picture or a big part of them, forget GetPixel/SetPixel — this is too slow.
For a better approach, check out this CodeProject article: A fast way to work on Windows bitmap pixel data without using the slow GetPixel and SetPixel methods[^].

See also another article — a tutorial: Bitmap Basics - A GDI tutorial[^].

—SA


您可以查看反谷物几何项目 [^ ]

很好:)

最好的问候
Espen Harlinn
You could take a look at the Anti-Grain Geometry Project[^]

It''s quite good :)

Best regards
Espen Harlinn


看看位图函数 [ ^ ],特别是SetPixel
have a look at The Bitmap Functions[^], specifically SetPixel


这篇关于图像中的像素编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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