http://img29.imageshack.us/img29/3247/thisjs.png
I have a question of scaling images.
When I scale an image with 1x7 in size to 82x7 for example,
it will be scaled but with a gradient of colour.
How can I solve it?
I am using graphic method to display the image.
And using the Graphics InterpolationMode cannot solve this problem.
Here is my code:
Bitmap top_left = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_top_left@n.tga");
Bitmap top_center = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_top_center@n.tga");
Bitmap top_right = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_top_right@n.tga");
Bitmap center_left = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_center_left@n.tga");
Bitmap center_center = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_center_center@n.tga");
Bitmap center_right = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_center_right@n.tga");
Bitmap bottom_left = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_bottom_left@n.tga");
Bitmap bottom_center = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_bottom_center@n.tga");
Bitmap bottom_right = TargaImage.LoadTargaImage(Application.StartupPath + "\\cstrike\\resource\\control\\textentry\\output_default_bottom_right@n.tga");
Rectangle tlr1 = new Rectangle(0, 0, top_left.Width, top_left.Height);
e.Graphics.DrawImage(top_left, tlr1);
Rectangle tcr1 = new Rectangle(top_left.Width, 0, (ClientSize.Width - (top_left.Width + top_right.Width)), top_left.Height);
e.Graphics.DrawImage(top_center, tcr1);
Rectangle trr1 = new Rectangle((ClientSize.Width - top_left.Width), 0, top_right.Width, top_right.Height);
e.Graphics.DrawImage(top_right, trr1);
Rectangle clr1 = new Rectangle(0, top_left.Height, center_left.Width, (ClientSize.Height - (top_left.Height + bottom_left.Height)));
e.Graphics.DrawImage(center_left, clr1);
Rectangle ccr1 = new Rectangle(center_left.Width, top_left.Height, (ClientSize.Width - (center_left.Width + center_right.Width)), (ClientSize.Height - (top_left.Height + bottom_left.Height)));
e.Graphics.DrawImage(center_center, ccr1);
Rectangle crr1 = new Rectangle((ClientSize.Width - center_left.Width), top_left.Height, center_right.Width, (ClientSize.Height - (top_left.Height + bottom_right.Height)));
e.Graphics.DrawImage(center_right, crr1);
Rectangle blr1 = new Rectangle(0, (ClientSize.Height - top_left.Height), center_left.Width, bottom_left.Width);
e.Graphics.DrawImage(bottom_left, blr1);
Rectangle bcr1 = new Rectangle(bottom_left.Width, (ClientSize.Height - top_left.Height), (ClientSize.Width - (bottom_left.Width + bottom_right.Width)), bottom_center.Height);
e.Graphics.DrawImage(bottom_center, bcr1);
Rectangle brr1 = new Rectangle((ClientSize.Width - bottom_left.Width), (ClientSize.Height - top_left.Height), bottom_right.Width, bottom_right.Height);
e.Graphics.DrawImage(bottom_right, brr1);