VC++读取图像RGB值
来源:互联网 发布:js隐藏和显示div 编辑:程序博客网 时间:2024/06/07 01:45
代码:
#include <iostream>#include <fstream>#include <string>#include <windows.h>#include <gdiplus.h>#pragma comment(lib, "gdiplus.lib")using namespace std;using namespace Gdiplus;int main() { GdiplusStartupInput gdiplusstartupinput; ULONG_PTR gdiplustoken; GdiplusStartup(&gdiplustoken, &gdiplusstartupinput, NULL); wstring infilename(L"1.jpg"); string outfilename("color.txt"); Bitmap* bmp = new Bitmap(infilename.c_str()); UINT height = bmp->GetHeight(); UINT width = bmp->GetWidth(); cout << "width " << width << ", height " << height << endl; Color color; ofstream fout(outfilename.c_str()); for (UINT y = 0; y < height; y++) for (UINT x = 0; x < width ; x++) { bmp->GetPixel(x, y, &color); fout << x << "," << y << ";" << (int)color.GetRed() << "," << (int)color.GetGreen() << "," << (int)color.GetBlue() << endl; } fout.close(); delete bmp; GdiplusShutdown(gdiplustoken); return 0;}
2 0
- VC++读取图像RGB值
- java:读取图像RGB信息
- matlab读取图像的RGB
- 3通道图像RGB值读取和灰度图像灰度值读取
- YUV 读取图像并转化成RGB
- C++读取图像的RGB值(两种方法,均经过测试)
- 彩色(RGB/HSV)&灰度 图像像素值读取并保存到txt文件
- OpenCV读取RGB图像像素值,并保存到txt中
- java读取图像的rpg以及灰度值,可以对rgb进行修改后输出新图像
- 读取颜色的RGB值
- 读取BMP图像每一像素点RGB数据
- 读取BMP图像每一像素点RGB数据
- <Matlab图像处理学习>之彩色图像的读取及RGB的数值读取
- VC GDAl 读取并显示图像
- vc使用opencv库 读取图像
- 【学习DCMTK】VC读取dicom图像
- 分离多通道图像RGB的值 !!!!
- 图像处理--RGB到HSI的彩色转换--图像分割(MFC VC++)
- 每天进步一点点——linux——tail
- Qt程序的UAC权限问题(转载)
- Hibernate进阶篇(四)——session详解
- 把图片转换成二进制--把二进制转换成图片
- 构建基于Nginx的文件服务器思路与实现
- VC++读取图像RGB值
- iOS之网络编程(POST异步)
- 不能说的hidden
- 洪秀柱于中常会参选理念之说明全文
- XBOX360新手扫盲
- xbox360 IX1.60 引导盘制作
- Xbox360游戏刻录傻瓜教程 ImgBurn…
- android 页面加载自动到顶部
- 程序员看法上的几个典型错误