So i'm creating a form, on the form is a panel (panel1) which holds all data, pictures etc... This is then to be made into a bmp for professional printing (ie 300dpi).
A4 @ 300dpi = 2480 x 3508;
i am able to create the image at the panel's height and width. and i have also recently got it to create a document 2480x3508, but the panel is being shown in the top left corner with a whole lot of white space.. what am i doing wrong?.. is there a Better way to create this image, as quality is a factor?.. this is my code below..
PANEL1
panel1.width = 826;
panel1.height = 1168;
Apologies if i sound noob.. ....but i am, have only just started with C#... thanks all.
Bitmap objBmpImage = new Bitmap((2480), (3508)); //create image
objBmpImage.SetResolution(300, 300); // set resolution to 300 dpi
Graphics objGraphics = Graphics.FromImage(objBmpImage); //create graphics object
panel1.DrawToBitmap(objBmpImage, new System.Drawing.Rectangle(0,0, 2480, 3508)); //draw panel onto image
using (SaveFileDialog dlgSave = new SaveFileDialog()) //SFD for user to select destination... which isnt working correctly either, but thats another issue
{
dlgSave.Title = "Save Image";
dlgSave.Filter = "Bitmap Images (*.bmp)|*.bmp|All Files (*.*)|*.*";
//make high quality
objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
objGraphics.CompositingMode = CompositingMode.SourceCopy;
objGraphics.CompositingQuality = CompositingQuality.HighQuality;
objGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
//draw image
objGraphics.DrawImage(objBmpImage, 0, 0, 2480, 3508);
//save
objBmpImage.Save(@"F:\new.bmp");