How do I convert centimeter to pixel in c# ?
int CentimeterToPixel(double Centimeter)
{
double pixel = -1;
using (Graphics g = this.CreateGraphics())
{
pixel = Centimeter * g.DpiY / 2.54d;
}
return (int)pixel;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With