Visual C++ .NET 2005 Bitmap Problem

Discussion in 'C++' started by mdavidjohnson, Sep 29, 2010.

  1. mdavidjohnson

    mdavidjohnson New Member

    Sep 29, 2010
    Likes Received:
    Trophy Points:
    I'm trying to learn how to modify Bitmaps programatically.

    As a first attempt, I'm trying to simply create a blank bitmap, programatically change it to all red, and display it in a pictureBox.

    The following code builds without error and, under "Start Without Debugging" runs without error except the blank pictureBox remains blank - no red bitmap is displayed in it. Any suggestions?

    private: System::Void button1_Click(System::Object^ sender,
    System::EventArgs^ e)
    Bitmap^ TempBitmap;
    TempBitmap = gcnew Bitmap(33,33);
    Color TempColor;
    unsigned char cArg;
    unsigned char cRed;
    unsigned char cGreen;
    unsigned char cBlue;
    for (int i=0; iImage = TempBitmap;
    label4->Text = "DONE";

    Yes, I know it's inefficient to put the color assignments inside the loop because they never change. But, since that's where I'll eventually put color modifications coding, they make good placeholders. :)

    M. David Johnson

    Edit by admin: no contact info permitted on the forum, thank you

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice