Link to home
Start Free TrialLog in
Avatar of riceman0
riceman0

asked on

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.
Avatar of AlexFM
AlexFM

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

ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial