I have got a System.Drawing.Bitmap
in my code.
The width is fix, the height varies.
What I want to do, is to add a white border around the bitma
You can use 'SetPixel' method of a Bitmap class, to set nesessary pixels with the color. But more convenient is to use 'Graphics' class, as shown below:
bmp = new Bitmap(FileName);
//bmp = new Bitmap(bmp, new System.Drawing.Size(40, 40));
System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bmp);
gr.DrawLine(new Pen(Brushes.White, 20), new Point(0, 0), new Point(0, 40));
gr.DrawLine(new Pen(Brushes.White, 20), new Point(0, 0), new Point(40, 0));
gr.DrawLine(new Pen(Brushes.White, 20), new Point(0, 40), new Point(40, 40));
gr.DrawLine(new Pen(Brushes.White, 20), new Point(40, 0), new Point(40, 40));