Pixel to Integer

  • Thread starter Thread starter Tech Aspirant
  • Start date Start date
T

Tech Aspirant

Guest
I am drawing a rectangle in C# in which I have a border width property like below where user will enter the value in the form of pixel

public int BorderWidth = 10; //10 is default value in pixel
public int RectBorderWidth
{
get { return BorderWidth; }
set { BorderWidth = value; }
}

How can I convert the pixel input to integer to draw a rectangle with specified width.

Pen pen = new Pen(limitColor, BorderWidth);
pen.Alignment = PenAlignment.Inset;
g.DrawRectangle(pen,
new Rectangle((-IntfImageSizeWidth - GISControl.GraphConst3) / 2,
(-IntfImageSizeWidth - Control.GraphConst3),
IntfImageSizeWidth + Control.GraphConst3,
IntfImageSizeWidth + Control.GraphConst3));

Continue reading...
 
Back
Top