Legend items appear blurry or clipped when rendering to a window


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Lance,

In order to be printable most chart properties related to line width are specified in points (instead of pixels). Depending on the resolution this width may not be a number which is an exact round to pixel. To workaround this you can specify pixel width to legend grid lines - for example:

           legend.HorizontalBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);
            legend.VerticalBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);
            legend.OuterLeftBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);
            legend.OuterRightBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);
            legend.OuterTopBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);
            legend.OuterBottomBorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel);

Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team


Lance Levendowski
Lance Levendowski
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 60, Visits: 157
Please try my example using a DPI setting of 125% and let me know if that allows you to reproduce the issue.  The resolution of my screen is 1920 x 1080.

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Lance,

We could not replicate the problem using the provided code below - please send an app replicating the problem to support@nevron.com. Also we were unable to replicate this problem using the standard examples shipped with the control.



Best Regards,
Nevron Support Team


Lance Levendowski
Lance Levendowski
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 60, Visits: 157
Legend items can appear blurry or clipped when NChartControl.Settings.RenderSurface = window.

Can this be prevented?

Run the following example to reproduce the issue.  Notice that the clipping of text in the legend depends on the size of the NChartControl.

Public Class LegendForm
  Inherits Windows.Forms.Form

  Private _ChartControl1 As Nevron.Chart.WinForm.NChartControl
  Private WithEvents _CheckBox1 As Windows.Forms.CheckBox

  Public Sub New()
    Call InitializeControls()
  End Sub

  Private Sub InitializeControls()
    Me.Size = New Drawing.Size(640, 392)
    Me.StartPosition = FormStartPosition.CenterScreen

    Dim lowResolutionDataSize As New Drawing.Size(20, 20)
    Dim highResolutionDataSize As New Drawing.Size(255, 255)

    Const renderSurface As Nevron.GraphicsCore.RenderSurface = Nevron.GraphicsCore.RenderSurface.Window
    Const shadingMode As Nevron.Chart.ShadingMode = Nevron.Chart.ShadingMode.Smooth
    Const triangulationMode As Nevron.Chart.MeshSurfaceCellTriangulationMode = Nevron.Chart.MeshSurfaceCellTriangulationMode.MaxDiagonal

    Dim chartBounds As New Drawing.Rectangle(0, 0, Me.ClientSize.Width, Me.ClientSize.Height - 24)
    Me._ChartControl1 = Tools.CreateChartControlWithMeshSurface(Me, "Low Res ZoneTexture", chartBounds, True, renderSurface, shadingMode, triangulationMode, lowResolutionDataSize)
    Me._ChartControl1.Anchor = AnchorStyles.Left Or AnchorStyles.Top Or AnchorStyles.Right Or AnchorStyles.Bottom

    Me._CheckBox1 = New Windows.Forms.CheckBox
    Me._CheckBox1.Text = "Render to Window"
    Me._CheckBox1.Location = New Drawing.Point(0, Me._ChartControl1.Bottom)
    Me._CheckBox1.AutoSize = True
    Me._CheckBox1.Anchor = AnchorStyles.Left Or AnchorStyles.Bottom
    Me._CheckBox1.Checked = (Me._ChartControl1.Settings.RenderSurface = Nevron.GraphicsCore.RenderSurface.Window)
    Me.Controls.Add(Me._CheckBox1)
  End Sub

  Private Sub _CheckBox1_CheckedChanged(sender As Object, e As System.EventArgs) Handles _CheckBox1.CheckedChanged
    If (Me._CheckBox1.Checked) Then
      Me._ChartControl1.Settings.RenderSurface = Nevron.GraphicsCore.RenderSurface.Window
    Else
      Me._ChartControl1.Settings.RenderSurface = Nevron.GraphicsCore.RenderSurface.Bitmap
    End If
  End Sub

End Class


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search