Expand|Select|Wrap|Line Numbers
- String position = cboPositions.Text;
- switch (position)
- {
- case "Absolute":
- x = 1; y = 1;
- break;
- case "TopLeft":
- x = 0; y = 0;
- break;
- case "TopRight":
- x = (int)(picContainer.Image.Width - sz.Width); y = 0;
- break;
- case "TopMiddle":
- x = (int)(picContainer.Image.Width - sz.Width) / 2; y = 0;
- break;
- case "BottomLeft":
- x = 0; y =(int) (picContainer.Image.Height - sz.Height);
- break;
- case "BottomRight":
- x = (int)(picContainer.Image.Width - sz.Width); y = (int)(picContainer.Image.Height - sz.Height);
- break;
- case "BottomMiddle":
- x =(int) (picContainer.Image.Width - sz.Width) / 2; y =(int) (picContainer.Image.Height - sz.Height);
- break;
- case "MiddleLeft":
- x = 0; y =(int) (picContainer.Image.Height - sz.Height) / 2;
- break;
- case "MiddleRight":
- x =(int) (picContainer.Image.Width - sz.Width); y = (int)(picContainer.Image.Height - sz.Height) / 2;
- break;
- case "Center":
- x =(int)(picContainer.Image.Width - sz.Width) / 2; y =(int) (picContainer.Image.Height - sz.Height) / 2;
- break;
- default:
- break;
- g.DrawString(txtWaterMark.Text, myFont, myBrush, new Point(x, y));