Jump to content
Software FX Community

Print Preview/Printing artifacts


jzdecourcy

Recommended Posts

  • 3 weeks later...

Unfortunately, there is no way to optimize the look for the gauge labels; however, as a workaround, you could export the gauge to a memory stream, and draw the image directly to the Print Object in the PrintPage() Event using GDI+. You could provide a button in your application for PrintPreview, for example, which will fire this PrintPage() event thus showing the gauge image with much better quality. Below, please find a code snippet on how to implement this solution:

public partial class _Default : System.Web.UI.Page

{

private MemoryStream ms;protected void Page_Load(object sender, EventArgs e)

{

ms = new MemoryStream();

RadialGauge1.MainValue = 75;

RadialGauge1.MainScale.Min = 0;

RadialGauge1.MainScale.MinAlwaysDisplayed = true;

RadialGauge1.MainScale.Max = 100;

RadialGauge1.MainScale.MaxAlwaysDisplayed =

true;RadialGauge1.Export(ImageFormat.Jpeg, ms);

ms.Position = 0;

PrintDocument pd = new PrintDocument();

pd.PrintPage +=

new PrintPageEventHandler(pd_PrintPage);System.Windows.Forms.PrintPreviewDialog ppd = new System.Windows.Forms.PrintPreviewDialog();

ppd.Document = pd;

ppd.ShowDialog();

}

void pd_PrintPage(object sender, PrintPageEventArgs e)

{

e.Graphics.DrawImage(System.Drawing.Image.FromStream(ms), new Point(25, 25));

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...