Hello @ all I have a problem with my generated PNG - Images. It's a bit strange for me but may be someone now what i can do to solve this problem. My windows service create on the fly PNG - Images and store them as binary in a database. The stored images are displayed later with a crystal report in a windows app. That works very fine since years and also with different pc's (most XP-OS), but there is a problem with a new PC (XP-OS) since a few days. All images are displayed shrunken in the reports and it's not the whole report.... only the images. Text- and Report still proportional. Could it be that something is missing at the new machine ? Any ideas how this could be ? Thanks a lot!
Bitmap couponImg = null;
Font font = null;
Graphics graphic = null;
try
{
couponImg = new Bitmap(coupon.Width, coupon.Height, PixelFormat.Format24bppRgb);
using (graphic = Graphics.FromImage(couponImg)) //V1.01.03.01
{
graphic.Clear(coupon.BackgroundColor);
graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
graphic.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
graphic.TextContrast = 0;
graphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
graphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
if (coupon.couponCellCollection != null && coupon.couponCellCollection.Count > 0)
{
for (int idx = 0; idx < coupon.couponCellCollection.Count; idx++)
{
font = new Font(coupon.font, (float)coupon.couponCellCollection\[idx\].fFontSize, FontStyle.Bold, GraphicsUnit.Millimeter);
graphic.DrawString(coupon.couponCellCollection\[idx\].sCellValue, font, Brushes.Black, new PointF(coupon.couponCellCollection\[idx\].iPosX, coupon.couponCellCollection\[idx\].iPosY));
font = null;
}
}
graphic.DrawImage(couponImg, new Rectangle(0, 0, coupon.Width, coupon.height), 0, 0, coupon.Width, coupon.height, GraphicsUnit.Pixel);
graphic.Flush(); //V1.01.03.01
}
}
}
catch (Exception)
{
couponImg = null;
}
finally
{
if (graphic != null)
{