如何将int数组转换为位图? [英] How to convert a int array to bitmap?

查看:84
本文介绍了如何将int数组转换为位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个关于将int数组int lightness [] []转换为位图的问题.这个问题的目的是显示位图并显示地图的亮度.

我写了一个C#代码,但是我不怎么在可视C ++中实现它.

Hi all,

I have a question about converting a int array int lightness[][] to bitmap. The purpose of this question is to show a bitmap and display the lightness of map.

I wrote a c# code, but i don''t how to implement it in visual c++.

Bitmap sample = new Bitmap(width, height);

  for (int j = 0; j < sample.Height; j++)
  {
      for (int i = 0; i < sample.Width; i++)
      {
          int v = (int)lightness[j * sample.Width + i];
          sample.SetPixel(i, j, Color.FromArgb(v,v,0));
      }
  }



非常感谢.



many thanks.

推荐答案

http://www.cplusplus .com/forum/beginner/12848/ [ ^ ]


这篇关于如何将int数组转换为位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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