Create a bitmap from raw RGB data?

Posted on 2006-03-25
Last Modified: 2006-11-18

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?

Question by:riceman0
    LVL 48

    Expert Comment

    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)

    LVL 48

    Accepted Solution


    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))

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now