Hello:
I have an image that is 1 x 1.
Image img = new Bitmap(1, 1);
Graphics g = Graphics.FromImage(img);
g.FillRectangle(Brushes.Black, 0, 0, img.Width, img.Height);
g.Dispose();
Well, as you can see this image is just a black box. Well, I have another graphics device that I'm trying to call DrawImage().
I want to have the black box fill a specific porition of the graphics device.
EXA:
g.DrawImage(img, new Rectangle(x, y, w, h), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel);
You can see that the image is going to be stretched, but when it stretches pretty far, it is performing a gradient; it starts from black, moves to gray, and eventually fades to white if the distance is large.
I know I could just perform a grfx.FillRectangle(), but this NEEDS to be an image (long story). Also, the variables (x, y, w, h) are not known until runtime, so I can't just hard code the dimensions, and I don't want to create a HUGE bitmap and compress it. As such, I ask, "Is it possible to have the black expand without the gradient effect using my 1 x 1 black image?"
Thank you.
Trecius