c# - Transform pixel height of image to printing size used by graphics object -
As part of a print process of my application I am trying to print a list of images of other The problem placed below is that I can not figure out how to height the pixels of the images, how can I change the height in the units used by the graphics object during printing. How can I calculate the image print of the snow print?
This code snippet is part of the image printing loop that scales the image and calculates the height and placement of the next image.
image image = image.fromstream (imagestream); // Receive Proper Right Height Int Image Lightweight = Image. Height * imageWidth / image.Width; Image ImageTipPrint = Image. Gettabilmize (ImageView, ImageHit, Blank, IntPtr.Zero); Float Image High Print = E. Graphics. DIPI * ImageToPrint HEIGHT / IMAGEPRINT Vertical resolution; E.Graphics.DrawImage (imageToPrint, e.MarginBounds.Left, yPos); YPos + = ImageHyatPrint;I found the right solution after dismissing the document.
This line:
float image heit print = e.Graphics.DpiY * imageToPrint.Highlight / imageToPrint.VerticalResolution;Should be changed to:
Float Image Heat Print = ImageTipPrint. HEIGHT / IMAGEPRINT.Vertical Solution * 100;The biggest thing was that the height-end should be one hundredths of an inch.
Comments
Post a Comment