Profile Picture

Legend items appear blurry or clipped when rendering to a window

Posted By Lance Levendowski 9 Years Ago

Legend items appear blurry or clipped when rendering to a window

Author
Message
Lance Levendowski
Posted 9 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: Last Year
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






Similar Topics


Reading This Topic

3 active, 3 guests, 0 members, 0 anonymous.
No members currently viewing this topic!