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.
riceman0Asked:
Who is Participating?
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.