• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

Create a bitmap from raw RGB data?


Hey, I have three arrays, R(10,10) as byte, G(10,10) as byte, and B(10, 10) as byte, with data in them.

What's the easiest way to create a bitmap object populated with this pixel color data?

Thanks.
0
riceman0
Asked:
riceman0
  • 2
1 Solution
 
AlexFMCommented:
Dim bmp as Bitmap
Dim i as Integer
Dim j as Integer
bmp = new Bitmap(10, 10, PixelFormat.Format24bppRgb)

for i = 0 to 10
    for j = 0 to 10
        bmp.SetPixel(i, j, Color.FromARGB(R(i, j), G(i, j), B(i, j)
     next
next

0
 
AlexFMCommented:
Correction:

for i = 0 to 9
    for j = 0 to 9
        bmp.SetPixel(i, j, Color.FromARGB(R(i, j), G(i, j), B(i, j))
     next
next
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now