I want to convert my measures taht is in pixels to cm in c# but I can't
I search MSDN but can't find useful information
Please help me

You may have a measurement in pixels but the physical size depends on the resolution of the monitoring rendering the image, or the display settings of the image when printing.

Here is an example of getting the measurements in inches which can be easily converted to CM:

private void button2_Click(object sender, EventArgs e)
    {
      Image img = Image.FromFile(@"C:\picture.bmp");
      int pixelHeight = img.Size.Height;
      int pixelWidth = img.Size.Width;
      float physicalHeight = img.Size.Height / img.VerticalResolution; //hundreths of an inch
      float physicalWidth = img.Size.Width / img.HorizontalResolution; //hundreths of an inch
      System.Diagnostics.Debugger.Break();
    }

Have you found a solution to your question? If so then please mark this thread as solved and good luck!

A Graphics object also has DpiX and DpiY horizontal and vertical resolution fields. If you divide these by 2.54 you get something in cm.

This question has already been answered. Start a new discussion instead.