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 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
|