public override void InitDefault() { base.InitDefault(); m_SplashImage = NResourceHelper.BitmapFromResource(this.GetType(), "ChartSplash.png", "Nevron.Examples.Chart.WinForm.Resources"); m_sExamplesNamespace = "Nevron.Examples.Chart.WinForm"; m_sTreeResource = "ExamplesTree.xml"; m_sTreeResourcePath = "Nevron.Examples.Chart.WinForm.Resources"; m_FilterSearchResultsByParentTitles = new string[] { "C# Examples", "All Examples", "What's New" }; m_EmbeddedResourcesAssembly = typeof(NChartExamplesConfig).Assembly; m_FormIcon = NResourceHelper.IconFromResource(this.GetType(), "Chart.ico", "Nevron.Examples.Chart.WinForm.Resources"); m_sFormText = "Nevron Chart for Windows Forms - Part of Nevron .NET Vision - Examples"; m_bSearchForVbSourceFiles = false; m_iExampleTreeNodeImageIndex = 0; m_iExampleTreeNodeSelectedImageIndex = 1; m_sReportBugString = "mailto:[email protected]?subject=Chart Bug Report"; m_sFeedbackString = "mailto:[email protected]?subject=Chart Feedback"; this.LayoutStrategy = new NExamplesLayoutStrategy(); ProductName = "Nevron Chart for .NET"; ProductLogo = NResourceHelper.BitmapFromResource(this.GetType(), "ChartLogo.png", "Nevron.Examples.Chart.WinForm.Resources"); ProductAssemblies = new System.Reflection.Assembly[] { typeof(Nevron.Chart.WinForm.NChartControl).Assembly }; }
public override void InitDefault() { base.InitDefault(); m_SplashImage = NResourceHelper.BitmapFromResource(typeof(NMainForm), "DiagramSplash.png", "Nevron.Examples.Diagram.WinForm.Resources"); m_sExamplesNamespace = "Nevron.Examples.Diagram.WinForm"; m_sTreeResource = "ExamplesTree.xml"; m_sTreeResourcePath = "Nevron.Examples.Diagram.WinForm.Resources"; m_sFormText = "Nevron Diagram for Windows Forms - Part of Nevron .NET Vision - Examples"; m_FormIcon = NResourceHelper.IconFromResource(typeof(NMainForm), "Diagram.ico", "Nevron.Examples.Diagram.WinForm.Resources"); m_sFeedbackString = "mailto:[email protected]?subject=Diagram Feedback"; m_iExampleTreeNodeImageIndex = 11; m_iExampleTreeNodeSelectedImageIndex = 12; m_EmbeddedResourcesAssembly = this.GetType().Assembly; m_LayoutStrategy = new NDiagramExamplesLayoutStrategy(); ProductLogo = NResourceHelper.BitmapFromResource(typeof(NMainForm), "DiagramLogo.png", "Nevron.Examples.Diagram.WinForm.Resources"); ProductName = "Nevron Diagram for .NET"; ProductAssemblies = new System.Reflection.Assembly[] { typeof(NDiagramCommandBarsManager).Assembly }; }
private void SurfaceSizeCombo_SelectedIndexChanged(object sender, EventArgs e) { NGridSurfaceSeries surface = (NGridSurfaceSeries)nChartControl1.Charts[0].Series[0]; string heightMapName = ""; switch (surfaceSizeCombo.SelectedIndex) { case 0: heightMapName = "HeightMap0500.png"; break; case 1: heightMapName = "HeightMap1024.png"; break; default: return; } Bitmap bitmap = NResourceHelper.BitmapFromResource(this.GetType(), heightMapName, "Nevron.Examples.Chart.WinForm.Resources"); surface.Data.InitFromBitmap(bitmap); bitmap.Dispose(); nChartControl1.Refresh(); }
public NRangeSlidersUC(MainForm f) : base(f) { m_Image = NResourceHelper.BitmapFromResource(this.GetType(), "UISplash.png", "Nevron.Examples.UI.WinForm.Resources"); InitializeComponent(); Dock = DockStyle.Fill; }
private void BackgroundFillStyleComboBox_SelectedIndexChanged_1(object sender, System.EventArgs e) { switch (BackgroundFillStyleComboBox.SelectedIndex) { case 0: // Solid color nChartControl1.BackgroundStyle.FillStyle = new NColorFillStyle(Color.BlanchedAlmond); break; case 1: // Gradient nChartControl1.BackgroundStyle.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant2, Color.AliceBlue, Color.BlanchedAlmond); break; case 2: // Image { NImageFillStyle imageFillStyle = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Back.png", "Nevron.Examples.Chart.WinForm.Resources")); imageFillStyle.TextureMappingStyle.MapLayout = MapLayout.Tiled; nChartControl1.BackgroundStyle.FillStyle = imageFillStyle; } break; case 3: // Pattern nChartControl1.BackgroundStyle.FillStyle = new NHatchFillStyle(HatchStyle.Divot, Color.BlueViolet, Color.Beige); break; case 4: // Advanced gradient nChartControl1.BackgroundStyle.FillStyle = new NAdvancedGradientFillStyle(AdvancedGradientScheme.Ocean3, 12); break; } nChartControl1.Refresh(); }
public override void Initialize() { base.Initialize(); this.nButton1.TransparentBackground = true; this.nCommandContext1.Properties.ImageInfo.Image = NResourceHelper.BitmapFromResource(this.GetType(), "JournalSmall.png", "Nevron.Examples.UI.WinForm.Resources.Images.NavigationPane"); this.nCommand1.Properties.ImageInfo.Image = NResourceHelper.BitmapFromResource(this.GetType(), "JournalSmall.png", "Nevron.Examples.UI.WinForm.Resources.Images.NavigationPane"); nCommandBarsManager1.ApplyPalette(NUIManager.Palette); NSkinResource resource = new NSkinResource(SkinResourceType.EntryAssembly, "ButtonsSkin"); m_ButtonsSkin1 = new NSkin(); m_ButtonsSkin1.Load(resource); resource.SkinName = "ScrollbarsSkin"; m_ScrollbarsSkin1 = new NSkin(); m_ScrollbarsSkin1.Load(resource); FillSkinCombo(buttonsSkinCombo); FillSkinCombo(scrollSkinCombo); FillSkinCombo(commandBarsSkinCombo); buttonsSkinCombo.SelectedIndex = 1; scrollSkinCombo.SelectedIndex = 4; commandBarsSkinCombo.SelectedIndex = 5; }
private void SurfaceSizeComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { NGridSurfaceSeries surface = (NGridSurfaceSeries)nChartControl1.Charts[0].Series[0]; string heightMapName = ""; switch (SurfaceSizeComboBox.SelectedIndex) { case 0: heightMapName = "HeightMap0500.png"; break; case 1: heightMapName = "HeightMap1024.png"; break; default: return; } using (Bitmap bitmap = NResourceHelper.BitmapFromResource(this.GetType(), heightMapName, "Nevron.Examples.Chart.Wpf.Resources.Images")) { surface.Data.InitFromBitmap(bitmap); } nChartControl1.Refresh(); }
public override void Initialize() { base.Initialize(); // set a chart title NLabel title = new NLabel("Heat Map"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); NChart chart = nChartControl1.Charts[0]; chart.BoundsMode = BoundsMode.Stretch; // create the heat map (will be updated on timer tick) m_HeatMap = new NHeatMapSeries(); m_HeatMap.Data.SetGridSize(m_SizeX, m_SizeY); m_HeatMap.Data.SetValues(double.NaN); m_HeatMap.Legend.Mode = SeriesLegendMode.SeriesLogic; // used to display palette information m_HeatMap.Legend.PaletteLegendMode = PaletteLegendMode.GradientAxis; m_HeatMap.Legend.PaletteScaleStepMode = PaletteScaleStepMode.SynchronizeWithScaleConfigurator; m_HeatMap.Legend.PaletteLength = new NLength(400); NNumericScaleConfigurator numericScale = m_HeatMap.Legend.PaletteScaleConfigurator as NNumericScaleConfigurator; numericScale.MajorTickMode = MajorTickMode.CustomStep; numericScale.CustomStep = 10; m_HeatMap.Palette.Mode = PaletteMode.AutoMinMaxColor; m_HeatMap.Palette.PositiveColor = Color.FromArgb(125, Color.Red); m_HeatMap.Palette.ZeroColor = Color.FromArgb(125, Color.Blue); m_HeatMap.Palette.SmoothPalette = true; chart.Series.Add(m_HeatMap); // add background image NRangeSeries range = new NRangeSeries(); range.UseXValues = true; range.DataLabelStyle.Visible = false; range.Legend.Mode = SeriesLegendMode.None; range.Values.Add(0); range.Y2Values.Add(m_SizeY); range.XValues.Add(0); range.X2Values.Add(m_SizeX); Bitmap bitmap = NResourceHelper.BitmapFromResource(this.GetType(), "USMap.png", "Nevron.Examples.Chart.WinForm.Resources"); range.FillStyle = new NImageFillStyle(bitmap); chart.Series.Add(range); timer1.Interval = 100; timer1.Start(); ConfigureStandardLayout(chart, title, nChartControl1.Legends[0]); }
private void InitFormControls() { PauseEventsHandling(); // string items TreeNode stringItems = new TreeNode("String items"); TreeNode string1 = new TreeNode("Nevron Diagram for .NET"); string1.Tag = "Dragged and dropped text"; stringItems.Nodes.Add(string1); TreeNode string2 = new TreeNode("Text2"); string1.Tag = "Nevron Diagram for .NET"; stringItems.Nodes.Add(string1); treeView.Nodes.Add(stringItems); // image items TreeNode imageItems = new TreeNode("Image items"); TreeNode image1 = new TreeNode("Man"); image1.Tag = NResourceHelper.BitmapFromResource(GetType(), "man7.jpg", "Nevron.Examples.Diagram.WinForm.Resources"); imageItems.Nodes.Add(image1); TreeNode image2 = new TreeNode("Woman"); image2.Tag = NResourceHelper.BitmapFromResource(GetType(), "woman1.jpg", "Nevron.Examples.Diagram.WinForm.Resources"); imageItems.Nodes.Add(image2); treeView.Nodes.Add(imageItems); // shape items TreeNode shapeItems = new TreeNode("Shape items"); TreeNode shape1 = new TreeNode("Rectangle"); shape1.Tag = new NMyDataObject("Rectangle", new NSizeF(20, 30)); shapeItems.Nodes.Add(shape1); TreeNode shape2 = new TreeNode("Ellipse"); shape2.Tag = new NMyDataObject("Ellipse", new NSizeF(30, 20)); shapeItems.Nodes.Add(shape2); treeView.Nodes.Add(shapeItems); ResumeEventsHandling(); }
public NTreeViewExAppearanceUC() { InitializeComponent(); Dock = DockStyle.Fill; m_Images = new Image[6]; string path = "Nevron.Examples.UI.WinForm.TreeView.Resources"; Type t = typeof(NTreeViewExAppearanceUC); m_Images[0] = NResourceHelper.BitmapFromResource(t, "TreeView1.png", path); m_Images[1] = NResourceHelper.BitmapFromResource(t, "TreeView2.png", path); m_Images[2] = NResourceHelper.BitmapFromResource(t, "TreeView3.png", path); m_Images[3] = NResourceHelper.BitmapFromResource(t, "TreeView4.png", path); m_Images[4] = NResourceHelper.BitmapFromResource(t, "TreeView5.png", path); m_Images[5] = NResourceHelper.BitmapFromResource(t, "TreeView6.png", path); }
internal void InitShapedPopups() { m_ShapedPopup1 = new NPopupNotify(); m_ShapedPopup2 = new NPopupNotify(); m_ShapedPopup3 = new NPopupNotify(); m_ShapedPopup1.PredefinedStyle = PredefinedPopupStyle.Shaped; m_ShapedPopup2.PredefinedStyle = PredefinedPopupStyle.Shaped; m_ShapedPopup3.PredefinedStyle = PredefinedPopupStyle.Shaped; Type type = typeof(NPopupNotifyUC); string path = "Nevron.Examples.UI.WinForm.PopupNotify"; m_ShapedPopup1.ShapeTransparentColor = Color.Magenta; m_ShapedPopup2.ShapeTransparentColor = Color.Magenta; m_ShapedPopup3.ShapeTransparentColor = Color.Magenta; m_ShapedPopup1.Shape = NResourceHelper.BitmapFromResource(type, "notification3.bmp", path); m_ShapedPopup1.Caption.ButtonSize = new NSize(20, 20); m_ShapedPopup1.Caption.ButtonsMargins = new NPadding(0, 4, 0, 6); m_ShapedPopup1.MoveableBounds = new Rectangle(100, 69, 226, 10); m_ShapedPopup1.CaptionBounds = new Rectangle(80, 69, 246, 30); m_ShapedPopup1.ContentBounds = new Rectangle(100, 79, 206, 46); m_ShapedPopup2.Shape = NResourceHelper.BitmapFromResource(type, "notification1.bmp", path); m_ShapedPopup2.Content.Padding = new NPadding(6, 0, 0, 0); m_ShapedPopup2.Caption.ButtonsMargins = new NPadding(0, 6, 0, 23); m_ShapedPopup2.Content.Text = "<font color='#606060' face='Tahoma'><b>Meet John!</b></font>"; m_ShapedPopup3.Shape = NResourceHelper.BitmapFromResource(type, "notification2.bmp", path); m_ShapedPopup3.Caption.ButtonsMargins = new NPadding(0, 3, 0, 4); m_ShapedPopup3.Content.Text = "<font face='Trebuchet MS' color='brown' size='10'><b>Welcome to<br/>Nevron UI for .NET</b></font>"; NImageAndTextItem item = m_ShapedPopup1.Content; item.Text = "<u><font face='Verdana' color='Red'><i>You have 1 <font color='Navy'>new</font> message(s)!</i></font></u>"; ImageList list = NResourceHelper.ImageListFromBitmap(type, new Size(20, 20), Color.Magenta, "close.bmp", path); NUIItemImageSet imageSet = m_ShapedPopup1.CloseButtonImageSet; imageSet.NormalImage = list.Images[0]; imageSet.HotImage = list.Images[1]; imageSet.PressedImage = list.Images[2]; }
public override void Initialize() { base.Initialize(); this.nCommandBarsManager1.Palette.Copy(NUIManager.Palette); Type t = GetType(); nDockingToolbar1.ImageSize = new Size(48, 48); string path = "Nevron.Examples.UI.WinForm.Resources.Images"; Bitmap bmp = NResourceHelper.BitmapFromResource(t, "Clock.png", path); nCommand1.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Envelope.png", path); nCommand2.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Flash.png", path); nCommand3.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Book.png", path); nCommand4.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Pencil.png", path); nCommand5.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Light.png", path); nCommand6.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Globe.png", path); nCommand7.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Mobile.png", path); nCommand8.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Flask.png", path); nCommand9.Properties.ImageInfo.Image = bmp; bmp = NResourceHelper.BitmapFromResource(t, "Darts.png", path); nCommand10.Properties.ImageInfo.Image = bmp; }
private void CreateConceptCarPanels(NDockPanel parentPanel, CarData car) { Bitmap conceptImage = NResourceHelper.BitmapFromResource(this.GetType(), car.ImageResourceName, "Nevron.Examples.Chart.WinForm.Resources"); NLabel label = new NLabel(car.AuthorName); label.DockMode = PanelDockMode.Top; label.BoundsMode = BoundsMode.Fit; label.UseAutomaticSize = true; label.Padding = new NMarginsL(10, 0, 0, 0); label.TextStyle.FontStyle = new NFontStyle("Times New Roman", 20, FontStyle.Italic); label.TextStyle.FillStyle = new NGradientFillStyle(Nevron.GraphicsCore.GradientStyle.Horizontal, GradientVariant.Variant1, Color.DarkKhaki, Color.White); parentPanel.ChildPanels.Add(label); NWatermark watermark = new NWatermark(); watermark.FillStyle = new NImageFillStyle(conceptImage); watermark.DockMode = PanelDockMode.Top; watermark.UseAutomaticSize = true; watermark.Padding = new NMarginsL(10, 0, 0, 0); watermark.Tag = car; parentPanel.ChildPanels.Add(watermark); }
public override void InitDefault() { base.InitDefault(); ProductType = ENDotNetProductType.NETUserInterface; Type t = typeof(MainForm); string path = "Nevron.Examples.UI.WinForm.Resources"; PersistFormState = false; //PersistPanelsState = false; WindowState = FormWindowState.Maximized; //specify about box m_SplashImage = NResourceHelper.BitmapFromResource(t, "UISplash.png", path); ProductLogo = NResourceHelper.BitmapFromResource(t, "UILogo.png", path); ProductName = "Nevron UI for .NET"; ProductAssemblies = new System.Reflection.Assembly[] { typeof(NUIManager).Assembly, typeof(NDockManager).Assembly }; m_FilterSearchResultsByParentTitles = new string[] { "C# Examples", "All Examples", "What's New" }; m_EmbeddedResourcesAssembly = typeof(NUIExamplesConfig).Assembly; m_sExamplesNamespace = "Nevron.Examples.UI.WinForm"; m_sTreeResource = "ExamplesTree.xml"; m_sTreeResourcePath = path; m_FormIcon = NResourceHelper.IconFromResource(t, "UI.ico", path); m_sFormText = "Nevron User Interface - Part of Nevron .NET Vision - Examples"; m_iExampleTreeNodeImageIndex = 13; m_iExampleTreeNodeSelectedImageIndex = 14; m_sFeedbackString = "mailto:[email protected]?subject=Nevron User Interface Feedback"; m_LayoutStrategy = new NUIExamplesLayoutStrategy(); }
static NCustomDiagramButtonCommand() { Type thisType = typeof(NCustomDiagramButtonCommand); ImageListCustom = new NCustomImageList(NResourceHelper.BitmapFromResource(thisType, "CustomCommandbarImageList.png", "Nevron.Examples.Diagram.WinForm.Resources"), new NSize(16, 16)); }
static NCustomChartCommander() { Type thisType = typeof(NCustomChartCommander); ImageListCustom = new NCustomImageList(NResourceHelper.BitmapFromResource(thisType, "CustomCommandbarImageList.png", "Nevron.Examples.Chart.WinForm.Resources"), new NSize(16, 16)); }
private Bitmap GetCountrlyFlagImage(string countryFlag) { return(NResourceHelper.BitmapFromResource(this.GetType(), countryFlag, "Nevron.Examples.Chart.WinForm.Resources")); }
internal void InitContexts() { Image img = NResourceHelper.BitmapFromResource(GetType(), "orang021.jpg", "Nevron.Examples.UI.WinForm.Resources.Backgrounds"); InitBackgroundImageContext(img, Contexts.BackgroundImage1); }
private void InitDocument() { Bitmap bitmap = NResourceHelper.BitmapFromResource(GetType(), "Airplane.png", "Nevron.Examples.Diagram.WinForm.Resources"); document.Width = bitmap.Width; document.Height = bitmap.Height + 62; document.BackgroundStyle.FillStyle = new NImageFillStyle(bitmap); // Create the style sheets NStyleSheet free = new NStyleSheet("free"); NStyle.SetInteractivityStyle(free, new NInteractivityStyle(string.Empty, CursorType.Hand)); NStyle.SetFillStyle(free, new NColorFillStyle(SEAT_COLOR)); NStyle.SetStrokeStyle(free, new NStrokeStyle(1, Color.Black)); NStyle.SetTextStyle(free, new NTextStyle(new Font(view.Font, FontStyle.Bold), Color.Blue)); document.StyleSheets.AddChild(free); NStyleSheet reserved = new NStyleSheet("reserved"); NHatchFillStyle hatch = new NHatchFillStyle(HatchStyle.LightUpwardDiagonal, Color.Red, SEAT_COLOR); hatch.TextureMappingStyle.MapMode = MapMode.RelativeToViewer; NStyle.SetFillStyle(reserved, hatch); NStyle.SetStrokeStyle(reserved, new NStrokeStyle(1, Color.Black)); document.StyleSheets.AddChild(reserved); float x, y; float distance = DISTANCE; NShape shape; Point startPoint = LINE1_LEFT; m_Seats = new List <NShape>(); // Draw the seats for (y = LINE1_LEFT.Y; y < 350; y += SEAT_SIZE.Height) { if (y > 260 && y < LINE2_LEFT.Y) { y = LINE2_LEFT.Y; startPoint = LINE2_LEFT; } if (y >= LINE2_LEFT.Y) { distance = 5.25f; } for (x = startPoint.X; x < 970; x += SEAT_SIZE.Width + distance) { if (x > 460 && x < LINE1_RIGHT.X) { x = LINE1_RIGHT.X; distance = DISTANCE; } m_nFreeSeats++; shape = new NRectangleShape(x, y, SEAT_SIZE.Width, SEAT_SIZE.Height); shape.StyleSheetName = "free"; SetProtections(shape); document.ActiveLayer.AddChild(shape); m_Seats.Add(shape); } } // Free seats shape = new NRectangleShape(MARGINS, MARGINS, SEAT_SIZE.Width, SEAT_SIZE.Height); shape.StyleSheetName = "free"; SetProtections(shape); document.ActiveLayer.AddChild(shape); CreateTextShape(ref m_FreeSeats); m_FreeSeats.Location = new NPointF(shape.Bounds.Right + MARGINS, shape.Bounds.Y); // Reserved seats shape = new NRectangleShape(MARGINS, 2 * MARGINS + SEAT_SIZE.Height, SEAT_SIZE.Width, SEAT_SIZE.Height); shape.StyleSheetName = "reserved"; SetProtections(shape); document.ActiveLayer.AddChild(shape); CreateTextShape(ref m_ReservedSeats); m_ReservedSeats.Location = new NPointF(shape.Bounds.Right + MARGINS, shape.Bounds.Y); // Total revenue CreateTextShape(ref m_Revenue); m_Revenue.Location = new NPointF(shape.Bounds.Right + MARGINS, shape.Bounds.Bottom + MARGINS); m_Revenue.Style.TextStyle.FontStyle.Style = FontStyle.Bold; m_Revenue.Style.TextStyle.FillStyle = new NColorFillStyle(Color.MediumBlue); UpdateTexts(); }
public override void Initialize() { base.Initialize(); nChartControl1.Controller.Tools.Add(new NPanelSelectorTool()); nChartControl1.Controller.Tools.Add(new NTrackballTool()); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Shape Series used to display a house"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); // setup chart m_Chart = nChartControl1.Charts[0]; m_Chart.Enable3D = true; m_Chart.Depth = 55.0f; m_Chart.Width = 55.0f; m_Chart.Height = 55.0f; m_Chart.Projection.Type = ProjectionType.Perspective; m_Chart.Projection.Rotation = -19.0f; m_Chart.Projection.Elevation = 20.0f; // configure axes NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorTickMode = MajorTickMode.AutoMaxCount; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, true); linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale; linearScale.MajorTickMode = MajorTickMode.AutoMaxCount; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true); linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.Depth).ScaleConfigurator = linearScale; linearScale.MajorTickMode = MajorTickMode.AutoMaxCount; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, true); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true); NLegend legend = (NLegend)nChartControl1.Legends[0]; legend.Data.MarkSize = new NSizeL(20, 20); // create the door NShapeSeries shape = (NShapeSeries)m_Chart.Series.Add(SeriesType.Shape); shape.Name = "door"; shape.DataLabelStyle.Visible = false; shape.UseXValues = true; shape.UseZValues = true; shape.Shape = BarShape.Bar; shape.AddDataPoint(new NShapeDataPoint(-0.5, -0.25, -1.0, 0.5, 1.5, 0.02)); NImageFillStyle doorFS = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Door.jpg", "Nevron.Examples.Chart.WinForm.Resources")); shape.FillStyle = doorFS; // create the window shape = (NShapeSeries)m_Chart.Series.Add(SeriesType.Shape); shape.Name = "window"; shape.DataLabelStyle.Visible = false; shape.UseXValues = true; shape.UseZValues = true; shape.Shape = BarShape.Bar; shape.AddDataPoint(new NShapeDataPoint(0.4, 0.0, -1.0, 0.75, 1.0, 0.02)); NImageFillStyle windowFS = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Window.jpg", "Nevron.Examples.Chart.WinForm.Resources")); shape.FillStyle = windowFS; // create the house shape = (NShapeSeries)m_Chart.Series.Add(SeriesType.Shape); shape.Name = "house"; shape.DataLabelStyle.Visible = false; shape.UseXValues = true; shape.UseZValues = true; shape.Shape = BarShape.Bar; shape.AddDataPoint(new NShapeDataPoint(0.0, 0.0, 0.0, 2.0, 2.0, 2.0)); shape.FillStyle = new NColorFillStyle(Color.White); NImageFillStyle houseFS = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Cobblestone.jpg", "Nevron.Examples.Chart.WinForm.Resources")); houseFS.TextureMappingStyle.MapLayout = MapLayout.Tiled; houseFS.TextureMappingStyle.HorizontalScale = 0.1f; houseFS.TextureMappingStyle.VerticalScale = 0.1f; shape.FillStyle = houseFS; // create the roof shape = (NShapeSeries)m_Chart.Series.Add(SeriesType.Shape); shape.Name = "roof"; shape.DataLabelStyle.Visible = false; shape.UseXValues = true; shape.UseZValues = true; shape.Shape = BarShape.Pyramid; shape.AddDataPoint(new NShapeDataPoint(0.0, 1.5, 0.0, 2.4, 1.0, 2.4)); NImageFillStyle roofFS = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Rooftile.jpg", "Nevron.Examples.Chart.WinForm.Resources")); roofFS.TextureMappingStyle.MapLayout = MapLayout.Tiled; roofFS.TextureMappingStyle.HorizontalScale = 0.2f; roofFS.TextureMappingStyle.VerticalScale = 0.2f; shape.FillStyle = roofFS; // create the chimney shape = (NShapeSeries)m_Chart.Series.Add(SeriesType.Shape); shape.Name = "chimney"; shape.DataLabelStyle.Visible = false; shape.UseXValues = true; shape.UseZValues = true; shape.Shape = BarShape.Cylinder; shape.AddDataPoint(new NShapeDataPoint(0.75, 1.5, 0.0, 0.2, 1.0, 0.2)); NImageFillStyle chimneyFS = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Bricks.jpg", "Nevron.Examples.Chart.WinForm.Resources")); chimneyFS.TextureMappingStyle.MapLayout = MapLayout.Tiled; chimneyFS.TextureMappingStyle.HorizontalScale = 0.1f; chimneyFS.TextureMappingStyle.VerticalScale = 0.1f; shape.FillStyle = chimneyFS; // apply layout ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]); }
public override void Initialize() { base.Initialize(); nChartControl1.Settings.ShapeRenderingMode = ShapeRenderingMode.None; nChartControl1.Controller.Tools.Add(new NPanelSelectorTool()); nChartControl1.Controller.Tools.Add(new NTrackballTool()); // set a chart title NLabel title = nChartControl1.Labels.AddHeader("Mesh Surface With Texture"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // no legend nChartControl1.Legends.Clear(); // configure the chart NChart chart = nChartControl1.Charts[0]; chart.Enable3D = true; chart.Width = 60.0f; chart.Depth = 60.0f; chart.Height = 25.0f; chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveTilted); // setup axes NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator(); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, true); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); linearScale.RoundToTickMax = false; linearScale.RoundToTickMin = false; chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale = new NLinearScaleConfigurator(); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, true); linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true); linearScale.RoundToTickMax = false; linearScale.RoundToTickMin = false; chart.Axis(StandardAxis.Depth).ScaleConfigurator = linearScale; // setup surface NMeshSurfaceSeries surface = (NMeshSurfaceSeries)chart.Series.Add(SeriesType.MeshSurface); surface.Name = "Surface"; surface.FrameMode = SurfaceFrameMode.None; surface.FillMode = SurfaceFillMode.Uniform; surface.Data.SetGridSize(50, 50); FillData(surface); NImageFillStyle imageFillStyle = new NImageFillStyle(NResourceHelper.BitmapFromResource(this.GetType(), "Marble.jpg", "Nevron.Examples.Chart.WinForm.Resources")); imageFillStyle.TextureMappingStyle.MapLayout = MapLayout.Tiled; imageFillStyle.TextureMappingStyle.HorizontalScale = 0.1f; imageFillStyle.TextureMappingStyle.VerticalScale = 0.1f; surface.FillStyle = imageFillStyle; // apply layout ConfigureStandardLayout(chart, title, null); // form controls smoothShadingCheck.Checked = true; }
public override void Initialize() { base.Initialize(); // load textures from resources Bitmap bmp0 = NResourceHelper.BitmapFromResource(this.GetType(), "Back.png", "Nevron.Examples.Chart.WinForm.Resources"); Bitmap bmp1 = NResourceHelper.BitmapFromResource(this.GetType(), "Leafs.png", "Nevron.Examples.Chart.WinForm.Resources"); Bitmap bmp2 = NResourceHelper.BitmapFromResource(this.GetType(), "Banner.png", "Nevron.Examples.Chart.WinForm.Resources"); NImageFillStyle imageFillStyle = new NImageFillStyle(bmp0); imageFillStyle.TextureMappingStyle.MapLayout = MapLayout.Tiled; nChartControl1.BackgroundStyle.FillStyle = imageFillStyle; // add label NLabel title = nChartControl1.Labels.AddHeader("Image Fill Style"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); title.ContentAlignment = ContentAlignment.BottomCenter; title.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage)); // setup chart and axes m_Chart = nChartControl1.Charts[0]; m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective); m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.SoftTopLeft); m_Chart.Axis(StandardAxis.Depth).Visible = false; NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.LineStyle.Color = Color.White; linearScale = new NLinearScaleConfigurator(); m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale; linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; linearScale.MajorGridStyle.LineStyle.Color = Color.White; linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true); // Setup walls Color c = Color.FromArgb(128, 128, 192); imageFillStyle = new NImageFillStyle(bmp1); imageFillStyle.TextureMappingStyle.MapLayout = MapLayout.Tiled; m_Chart.Wall(ChartWallType.Back).FillStyle = imageFillStyle; m_Chart.Wall(ChartWallType.Left).FillStyle = imageFillStyle; m_Chart.Wall(ChartWallType.Floor).FillStyle = imageFillStyle; // create bubble chart m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble); m_Bubble.DataLabelStyle.Visible = false; m_Bubble.Legend.Mode = SeriesLegendMode.DataPoints; m_Bubble.BubbleShape = PointShape.Ellipse; m_Bubble.UseXValues = true; m_Bubble.InflateMargins = true; m_Bubble.BorderStyle.Width = new NLength(1, NGraphicsUnit.Pixel); m_Bubble.FillStyle = new NImageFillStyle(bmp2); GenerateData(); }
public override void Initialize() { base.Initialize(); // Enable GPU acceleration nChartControl1.Settings.RenderSurface = RenderSurface.Window; nChartControl1.Controller.Tools.Add(new NPanelSelectorTool()); nChartControl1.Controller.Tools.Add(new NTrackballTool()); // set a chart title NLabel title = new NLabel("Surface With Texture"); title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue); // no legends nChartControl1.Legends.Clear(); // configure the chart NChart chart = nChartControl1.Charts[0]; chart.Enable3D = true; chart.Width = 60.0f; chart.Depth = 60.0f; chart.Height = 15.0f; chart.BoundsMode = BoundsMode.Fit; chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveTilted); chart.Projection.Elevation = 45; chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.ShinyTopLeft); // setup Y axis NLinearScaleConfigurator scaleY = new NLinearScaleConfigurator(); scaleY.RoundToTickMax = false; scaleY.RoundToTickMin = false; scaleY.MinTickDistance = new NLength(10, NGraphicsUnit.Point); scaleY.MajorGridStyle.ShowAtWalls = new ChartWallType[] { ChartWallType.Left, ChartWallType.Back }; scaleY.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = scaleY; // setup X axis NLinearScaleConfigurator scaleX = new NLinearScaleConfigurator(); scaleX.RoundToTickMax = false; scaleX.RoundToTickMin = false; scaleX.MajorGridStyle.ShowAtWalls = new ChartWallType[] { ChartWallType.Floor, ChartWallType.Back }; scaleX.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX; // setup Z axis NLinearScaleConfigurator scaleZ = new NLinearScaleConfigurator(); scaleZ.RoundToTickMax = false; scaleZ.RoundToTickMin = false; scaleZ.MajorGridStyle.ShowAtWalls = new ChartWallType[] { ChartWallType.Floor, ChartWallType.Left }; scaleZ.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot; chart.Axis(StandardAxis.Depth).ScaleConfigurator = scaleZ; // add the surface series NGridSurfaceSeries surface = (NGridSurfaceSeries)chart.Series.Add(SeriesType.GridSurface); surface.Name = "Surface"; surface.FrameMode = SurfaceFrameMode.None; surface.FillMode = SurfaceFillMode.Uniform; surface.Data.SetGridSize(60, 60); FillData(); Bitmap bitmap = NResourceHelper.BitmapFromResource(this.GetType(), "Marble.jpg", "Nevron.Examples.Chart.WinForm.Resources"); NImageFillStyle imageFillStyle = new NImageFillStyle(bitmap); imageFillStyle.TextureMappingStyle.MapLayout = MapLayout.Tiled; imageFillStyle.TextureMappingStyle.HorizontalScale = 0.1f; imageFillStyle.TextureMappingStyle.VerticalScale = 0.1f; imageFillStyle.MaterialStyle.Diffuse = Color.FromArgb(204, 204, 0); imageFillStyle.MaterialStyle.Ambient = Color.FromArgb(51, 102, 153); imageFillStyle.MaterialStyle.Specular = Color.DarkGray; surface.FillStyle = imageFillStyle; // apply layout ConfigureStandardLayout(chart, title, null); // form controls smoothShadingCheck.Checked = true; texturePlaneCombo.SelectedIndex = 0; }
public override void Initialize() { base.Initialize(); m_arrImages = new Image[8]; m_arrSmallImages = new Image[8]; m_arrTexts = new string[8]; Label lb; Type t = GetType(); string path = "Nevron.Examples.UI.WinForm.Resources.Images.NavigationPane"; m_arrImages[0] = NResourceHelper.BitmapFromResource(t, "Mail.png", path); m_arrImages[1] = NResourceHelper.BitmapFromResource(t, "Calendar.png", path); m_arrImages[2] = NResourceHelper.BitmapFromResource(t, "Contacts.png", path); m_arrImages[3] = NResourceHelper.BitmapFromResource(t, "Tasks.png", path); m_arrImages[4] = NResourceHelper.BitmapFromResource(t, "Notes.png", path); m_arrImages[5] = NResourceHelper.BitmapFromResource(t, "Folders.png", path); m_arrImages[6] = NResourceHelper.BitmapFromResource(t, "Shortcuts.png", path); m_arrImages[7] = NResourceHelper.BitmapFromResource(t, "Journal.png", path); m_arrSmallImages[0] = NResourceHelper.BitmapFromResource(t, "MailSmall.png", path); m_arrSmallImages[1] = NResourceHelper.BitmapFromResource(t, "CalendarSmall.png", path); m_arrSmallImages[2] = NResourceHelper.BitmapFromResource(t, "ContactsSmall.png", path); m_arrSmallImages[3] = NResourceHelper.BitmapFromResource(t, "TasksSmall.png", path); m_arrSmallImages[4] = NResourceHelper.BitmapFromResource(t, "NotesSmall.png", path); m_arrSmallImages[5] = NResourceHelper.BitmapFromResource(t, "FoldersSmall.png", path); m_arrSmallImages[6] = NResourceHelper.BitmapFromResource(t, "ShortcutsSmall.png", path); m_arrSmallImages[7] = NResourceHelper.BitmapFromResource(t, "JournalSmall.png", path); m_arrTexts[0] = "Mail"; m_arrTexts[1] = "Calendar"; m_arrTexts[2] = "Contacts"; m_arrTexts[3] = "Tasks"; m_arrTexts[4] = "Notes"; m_arrTexts[5] = "Folders List"; m_arrTexts[6] = "Shortcuts"; m_arrTexts[7] = "Journal"; m_Pane = new NNavigationPane(); m_Pane.Dock = DockStyle.Left; for (int i = 0; i < 8; i++) { NNavigationPaneBand band = new NNavigationPaneBand(); band.ContextMenu = m_ContextMenu; lb = new Label(); lb.Text = m_arrTexts[i]; band.TooltipText = "Sample tooltip for '" + m_arrTexts[i] + "' band"; lb.Dock = DockStyle.Fill; lb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; lb.Parent = band; band.Image = m_arrImages[i]; band.SmallImage = m_arrSmallImages[i]; m_Pane.Controls.Add(band); band.Text = m_arrTexts[i]; } m_Pane.Parent = this; m_Pane.ButtonsPreferredHeight = 96; NSplitter splitter = new NSplitter(); splitter.Dock = DockStyle.Left; splitter.Parent = this; splitter.BringToFront(); this.optionsCommandCheck.Checked = true; }
public override void Initialize() { base.Initialize(); NImageAndTextItem item; string text; Type t = GetType(); string path = "Nevron.Examples.UI.WinForm.Resources.Images.TaskDialog"; m_TaskDialog = new NTaskDialog(); m_TaskDialog.PreferredWidth = 350; m_TaskDialog.PredefinedButtons = TaskDialogButtons.Yes | TaskDialogButtons.No | TaskDialogButtons.Cancel; m_TaskDialog.Title = "Nevron User Interface for .NET"; //customize header item = m_TaskDialog.Content; item.Style.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; item.TreatAsOneEntity = false; item.ImageAlign = ContentAlignment.BottomRight; item.TextAlign = ContentAlignment.TopLeft; item.ImageTextRelation = ImageTextRelation.None; item.ImageAlpha = 0.5f; item.Image = NResourceHelper.BitmapFromResource(t, "computer_48_hot.png", path); item.ImageSize = new NSize(48, 48); item.Style.TextFillStyle = new NAdvancedGradientFillStyle(AdvancedGradientScheme.Red, 8); item.Style.TextShadowStyle = new NShadowStyle(ShadowType.LinearBlur, Color.Gray, 1, 1, 1F, 1); text = "<b><font size='10' face='Verdana' color='navy'>Nevron User Interface for .NET Q4 2006 is available!</font></b>"; text += "<br/><br/>Following are the new features:"; text += "<br/><br/><u>Chart for .NET:</u><br/><br/>"; text += "<ul liststyletype='decimal'>"; text += "<li>Brand new axis model.</li>"; text += "<li>Greatly improved date-time support.</li>"; text += "<li>Date-time scrolling.</li>"; text += "</ul>"; text += "<br/><u>User Interface for .NET:</u><br/><br/>"; text += "<ul liststyletype='decimal'>"; text += "<li>Extended DateTimePicker.</li>"; text += "<li>Vista-like TaskDialog.</li>"; text += "<li>Hyper-links per element basis.</li>"; text += "</ul>"; text += "<br/><font size='10' color='black'>Download the new version now?</font>"; item.Text = text; item = m_TaskDialog.Footer; item.HyperLinkClick += new NHyperLinkEventHandler(OnFooterHyperLinkClick); Icon icon = SystemIcons.Information; NSize imageSize = new NSize(icon.Width, icon.Height); item.Image = NSystemImages.Information; item.ImageSize = imageSize; text = "For more information visit <a href='http://www.nevron.com/News.aspx?content=News'>www.nevron.com</a>"; item.Text = text; item = m_TaskDialog.Verification; item.Text = "In future download new versions automatically"; propertyGrid.SelectedObject = m_TaskDialog; }