Posted 27 June 2022, 6:53 am EST
Hi,
I am having an issue trying to export a SectionReport with a single barcode control to an image.
What I do is straight forward.
private void DrawBarcode(Page page, out Bitmap bmp)
{
var width = (int)Math.Ceiling(_reportPaperWidth * DPI);
var height = (int)Math.Ceiling(_reportPaperHeight * DPI);
bmp = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bmp);
g.FillRectangle(new SolidBrush(Color.White), 0, 0, width, height);
page.Draw(g, new RectangleF(0, 0, page.Width, page.Height));
}
The problem with this is the page dpi cannot be changed and it is always set to native dpi of 96. so the more I increase my bitmap dpi the smaller the content will be in the bitmap.
I tried to create pagereport and add the barcode control to it but I was not able to add SectionReport barcode to page report even when casting it as CustomReportItem.
How can I achieve high resolution image rendering if page resolution is set in stone?
thanks