Quote:> Let me clarify what I've done, even though it doesn't yet work:
Okay, here's what I did. I created a simple form. Dropped a button on
it and an Image. In the button click method, I did this:
void __fastcall TForm1::DrawClick(TObject *Sender)
Bitmap = new Graphics::TBitmap;
Bitmap->Height = Image1->Height;
Bitmap->Width = Image1->Width;
for (int iRow = 0; iRow < Bitmap->Height; iRow++)
for (int iCol = 0; iCol < Bitmap->Width; iCol++)
// PixelValues is an array of pointers to objects which contain info on
// iPixelColor = PixelValues[iRow * iWidth + iCol]->getPixelColor();
Bitmap->Canvas->Pixels[iCol][iRow] = (TColor) RGB(0,0,0); //iPixelColor, iPixelColor, iPixelColor);
Image1->Canvas->Draw(0, 0, Bitmap);
When I click the button, boom, a black square shows up.
The questions I have with what you posted are:
1) Where is this code? What event causes it to happen? Remember, once
you draw it on there, it will disappear whenever things need to get
refreshed (ahh, the wonders of windows). So if you do this at startup,
it just won't be there.
2) What is PixelValues? And if it is what it sounds like, it is already
an RGB value, so you can just put it into Pixels.
| Programmer Roger Wagner Publishing |
| http://world.std.com/~jdarnold |