using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Collections;
namespace A10
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
e.Graphics.PageUnit = GraphicsUnit.Millimeter;
float dpix = e.Graphics.DpiX;
float dpiy = e.Graphics.DpiY;
Pen p = new Pen(Color.Black,3);
Matrix mx=new Matrix(1f/dpix,0,0,1f/dpiy,0,0);
p.Transform= mx;
e.Graphics.DrawRectangle(p,0.5f,0.5f,1,1);
}
}