Creating a Form dynamically in inches
-
Hi, My aim is to create a form in inches and to print it. i know the code for printing the form but the main problem is creating the form in inches as dimension if anyone knows how to do this please do let me know sindhu tiwari
its me sid
-
Hi, My aim is to create a form in inches and to print it. i know the code for printing the form but the main problem is creating the form in inches as dimension if anyone knows how to do this please do let me know sindhu tiwari
its me sid
The Graphics class provides two methods, Graphics.DpiX and Graphics.DpiY, that gives you the Dots-per-inch resolution of the Device Context:
public void SetSize(float xInches, float yInches)
{
Graphics g = Graphics.FromHwnd(this.Handle);
this.Size = new Size((int)(xInches * g.DpiX), (int)(yInches * g.DpiY));
g.Dispose();
} -
Hi, My aim is to create a form in inches and to print it. i know the code for printing the form but the main problem is creating the form in inches as dimension if anyone knows how to do this please do let me know sindhu tiwari
its me sid
Assuming you're using WinForms, you can assume that there are 72 dots (pixels) per inch, so multiply up by 72.
Deja View - the feeling that you've seen this post before.
-
Assuming you're using WinForms, you can assume that there are 72 dots (pixels) per inch, so multiply up by 72.
Deja View - the feeling that you've seen this post before.
Pete O`Hanlon wrote:
Assuming you're using WinForms, you can assume that there are 72 dots (pixels) per inch, so multiply up by 72.
I think it's mostly 96 dpi these days.