private void MoveBrush(BrushInfo brush) { float speedX = brush.speedX; float speedY = brush.speedY; Vector3 p = brush.transform.position; float rad = brush.transform.localScale.x * 0.5f; if (p.x - rad < border) { speedX = Mathf.Abs(speedX); } if (p.z - rad < border) { speedY = Mathf.Abs(speedY); } if (p.x + rad > areaWidth - border) { speedX = -Mathf.Abs(speedX); } if (p.z + rad > areaHeight - border) { speedY = -Mathf.Abs(speedY); } brush.speedX = speedX; brush.speedY = speedY; p.x += speedX * Time.deltaTime; p.z += speedY * Time.deltaTime; brush.transform.position = p; }
public void UpdateFormControlColors(Office2007Theme theme) { switch (theme) { case Office2007Theme.Blue: BrushInfo gradient = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(208, 226, 247), Color.FromArgb(237, 240, 247)); this.gradientLabel1.BackgroundColor = gradient; this.gradientLabel2.BackgroundColor = gradient; this.gradientLabel3.BackgroundColor = gradient; this.gradientPanel1.BackgroundColor = gradient; break; case Office2007Theme.Black: BrushInfo gradient2 = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(181, 188, 198), Color.FromArgb(213, 221, 225)); this.gradientLabel1.BackgroundColor = gradient2; this.gradientLabel2.BackgroundColor = gradient2; this.gradientLabel3.BackgroundColor = gradient2; this.gradientPanel1.BackgroundColor = gradient2; break; case Office2007Theme.Silver: BrushInfo gradient3 = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(214, 219, 231), Color.FromArgb(226, 231, 239)); this.gradientLabel1.BackgroundColor = gradient3; this.gradientLabel2.BackgroundColor = gradient3; this.gradientLabel3.BackgroundColor = gradient3; this.gradientPanel1.BackgroundColor = gradient3; break; } }
/// <summary> /// Get interior BrushInfo points. /// </summary> /// <param name="curValue">The current value oof the cell.</param> /// <param name="sparkline">The sparkline</param> /// <returns>returns the BrushInfo interior</returns> private BrushInfo GetInteriorWinLoss(double curValue, ISparkLine sparkline) { BrushInfo interior = sparkline.ColumnStyle.ColumnColor; sparkline.Markers.ShowNegativePoint = true; int count = sparkline.GetNegativePoint().GetUpperBound(0); for (int index = 0; index <= count; index++) { if (Convert.ToDouble(curValue) == (double)sparkline.GetNegativePoint().GetValue(index) && sparkline.Markers.ShowNegativePoint) { interior = sparkline.Markers.NegativePointColor; } } if (Convert.ToDouble(curValue) == sparkline.StartPoint && sparkline.Markers.ShowStartPoint) { interior = sparkline.Markers.StartPointColor; } if (Convert.ToDouble(curValue) == sparkline.EndPoint && sparkline.Markers.ShowEndPoint) { interior = sparkline.Markers.EndPointColor; } if (Convert.ToDouble(curValue) == sparkline.HighPoint && sparkline.Markers.ShowHighPoint) { interior = sparkline.Markers.HighPointColor; } if (Convert.ToDouble(curValue) == sparkline.LowPoint && sparkline.Markers.ShowLowPoint) { interior = sparkline.Markers.LowPointColor; } return(interior); }
public void SetToDefaults() { this.antiAliasing = true; this.fontSmoothing = FontSmoothing.Smooth; this.primaryColor = ColorBgra.FromBgra(0, 0, 0, 255); this.secondaryColor = ColorBgra.FromBgra(255, 255, 255, 255); this.gradientInfo = new GradientInfo(GradientType.LinearClamped, false); this.penInfo = new PenInfo(PenInfo.DefaultDashStyle, 2.0f, PenInfo.DefaultLineCap, PenInfo.DefaultLineCap, PenInfo.DefaultCapScale); this.brushInfo = new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal); try { this.fontInfo = new FontInfo(new FontFamily("Arial"), 12, FontStyle.Regular); } catch (Exception) { this.fontInfo = new FontInfo(new FontFamily(GenericFontFamilies.SansSerif), 12, FontStyle.Regular); } this.textAlignment = TextAlignment.Left; this.shapeDrawType = ShapeDrawType.Outline; this.alphaBlending = true; this.tolerance = 0.5f; this.colorPickerClickBehavior = ColorPickerClickBehavior.NoToolSwitch; this.resamplingAlgorithm = ResamplingAlgorithm.Bilinear; this.selectionCombineMode = CombineMode.Replace; this.floodMode = FloodMode.Local; this.selectionDrawModeInfo = SelectionDrawModeInfo.CreateDefault(); }
internal void LoadSysParams() { PropertyInfo[] infos = typeof(Brushes).GetProperties(); List <BrushInfo> BrushArray = new List <BrushInfo>(); foreach (PropertyInfo f in infos) { SolidColorBrush brush = (SolidColorBrush)f.GetValue(null, null); brush.Freeze(); if (brush.Equals(Brushes.Transparent)) { continue; } BrushInfo bi = new BrushInfo(); bi.Name = f.Name; bi.CurBrush = brush; BrushArray.Add(bi); } SystemParams.AllBrushes = BrushArray.ToArray(); }
public void StartDraw(Transform StrokesContainer, BrushInfo BrushInf, float BrushWidth, Color color) { brushColor = color; brushWidth = BrushWidth; brushStyle = GetBrushStyle(); brushStyle.StartPaint(StrokesContainer, BrushInf, BrushWidth, color); }
private void colorPickerUIAdv1_Picked(object sender, ColorPickerUIAdv.ColorPickedEventArgs args) { //set the custom color to the form and RibbonControlAdv this.ColorScheme = ColorSchemeType.Managed; this.ribbonControlAdv1.OfficeColorScheme = ToolStripEx.ColorScheme.Managed; Office12ColorTable.ApplyManagedColors(this, args.Color); //Set the GradientLabel color this.gradientLabel1.BackgroundColor = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, new System.Drawing.Color[] { Color.WhiteSmoke, args.Color, Color.WhiteSmoke }); // Ensures that the PopupControlContainer is closed after the selection of a color. ColorPickerUIAdv cc = sender as ColorPickerUIAdv; Syncfusion.Windows.Forms.PopupControlContainer pcc = cc.Parent as Syncfusion.Windows.Forms.PopupControlContainer; if (pcc != null) { pcc.HidePopup(Syncfusion.Windows.Forms.PopupCloseType.Done); } BrushInfo bInfo = new BrushInfo(Syncfusion.Drawing.GradientStyle.PathEllipse, args.Color, Color.FromArgb(237, 240, 247)); df.gradientLabel1.BackgroundColor = bInfo; df.gradientLabel2.BackgroundColor = bInfo; df.gradientLabel3.BackgroundColor = bInfo; df.gradientPanel1.BackgroundColor = bInfo; this.toolStripButton29.Checked = false; this.popupControlContainer1.Size = this.colorPickerUIAdv1.Size; }
protected TreeNodeAdv GetNode(NodeData data) { var node = new TreeNodeAdv(data.Name); if (data.ImageIndex != -1) { node.LeftImageIndices = new[] { data.ImageIndex }; } node.SubItems.Add(new TreeNodeAdvSubItem(data.Value)); node.Expanded = data.Expanded; node.Tag = data.Metadata; if (data.LargerHeight) { var brush = new BrushInfo(Color.White); node.Height += 10; node.Background = brush; foreach (TreeNodeAdvSubItem item in node.SubItems) { item.Background = brush; } } return(node); }
void SynchronizeModel() { grid.Model.RowCount = this.model.Rows; grid.Model.ColCount = this.model.Cols; for (int col = 0; col < model.Cols; col++) { Color backColor = SystemColors.Window; if (Math.Abs(col - this.highlightColumn) < 2) { backColor = Color.Red; } BrushInfo interior = new BrushInfo(backColor); for (int row = 0; row < model.Rows; row++) { if (this.transpose) { grid.Model[row + 1, col + 1].CellValue = valueCounter + model[row, col]; } else { grid.Model[row + 1, col + 1].CellValue = valueCounter + model[col, row]; } grid.Model[row + 1, col + 1].Interior = interior; } } valueCounter = valueCounter + 1; if (valueCounter > 10000) { Application.Exit(); } }
/// <summary> /// Initializes a new instance of the /// <see cref = "CalendarPanel"/> /// class. /// </summary> public CalendarPanel() { Size = SizeConfig.GetSize(530, 375); Location = ControlConfig.GetLocation(); Font = FontConfig.FontSizeSmall; Margin = ControlConfig.Margin; ForeColor = ColorConfig.ForeColorGray; BackColor = ColorConfig.FormBackColorDark; Dock = ControlConfig.GetDockStyle(); Anchor = ControlConfig.GetAnchorStyle(); Visible = true; Enabled = true; Style = VisualStyle.Office2010; Office2010Theme = Office2010Theme.Blue; Border3DStyle = Border3DStyle.Flat; BorderColor = Color.Transparent; BorderStyle = BorderStyle.FixedSingle; FirstDayOfWeek = Day.Monday; BottomHeight = 30; DayNamesColor = ColorConfig.FormBackColorDark; DayNamesFont = new Font("Roboto", 10, FontStyle.Bold); DaysFont = FontConfig.FontSizeMedium; DaysColor = ColorConfig.FormBackColorDark; DaysHeaderInterior = new BrushInfo(SystemColors.ControlDark); HeadForeColor = Color.White; HeaderHeight = 40; HeadGradient = false; HeaderFont = new Font("Roboto", 12, FontStyle.Bold); HeaderStartColor = Color.FromArgb(70, 70, 70); }
public BrushInfo GetBrushInfo(GanttBar bar, string patternOfProdID) { BrushInfo brushinfo = null; if (bar.State == EqpState.SETUP) { brushinfo = new BrushInfo(Color.Red); } else if (bar.State == EqpState.IDLE || bar.State == EqpState.IDLERUN) { brushinfo = new BrushInfo(Color.White); } else if (bar.State == EqpState.PM) { brushinfo = new BrushInfo(Color.Black); } else if (bar.State == EqpState.DOWN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Gray, Color.Black); } else if (bar.IsGhostBar) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.LightGray, Color.White); } else { var color = GetBarColorByProductID(bar.ProductID); if (bar.WipInitRun == "Y") { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Black, color); } else { brushinfo = new BrushInfo(color); } } var selBar = this.SelectedBar; if (!this.EnableSelect || selBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!CompareToSelectedBar(bar, patternOfProdID)) { bar.BackColor = this.BrushEmpth.BackColor; return(this.BrushEmpth); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
public void InitBrush(BrushInfo info, Transform normalLookObj = null, float width = 0.1f, Color c = new Color()) { lineSize = width; lmat = new Material(info.brushMat); normalObj = normalLookObj; brushColor = c; lmat.color = brushColor; //lmat.SetColor("_Color", brushColor); }
private void ChangeBackgroundSelectedGroup(TreeNodeAdv grp, BrushInfo brush) { if (grp != null) { grp.Background = brush; if (grp.Expanded) foreach (TreeNodeAdv n in grp.Nodes) n.Background = brush; } }
///<summary> ///Renders the Column type Sparkline. ///</summary> ///<param name="paint">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param> ///<param name="sparkline">The Sparkline.</param> public void DrawSparkColumn(Graphics paint, Syncfusion.Windows.Forms.Chart.SparkLine sparkline) { int areaMarginX = 3; int areaMarginY = 3; var isNegative = false; int centerY = sparkline.ControlHeight / 2; double firstPointX = 0, firstPointY = 0; double areaWidth = sparkline.ControlWidth - areaMarginX * areaMarginX; double areaHeight = sparkline.ControlHeight - areaMarginY * areaMarginX; SparkLineSource sparkLineSource = new SparkLineSource(); var sourceList = (List <object>)sparkLineSource.GetSourceList(sparkline.Source, sparkline); if (sourceList.Count == 0) { return; } double lineInterval = areaWidth / (sourceList.Count); double lineRange = sparkline.HighPoint - 0; int valueY = 0; sparkline.NegativeItem = new double[sourceList.Count]; for (int k = 0; k < sourceList.Count; k++) { double Value = Convert.ToDouble(sourceList[k]); valueY = (int)Math.Abs(Value); if (Value < 0) { isNegative = true; } firstPointX = this.Sparkline.Location.X + lineInterval * k + (lineInterval / 2); firstPointY = this.Sparkline.Location.Y + (areaHeight * Value / lineRange); if (!isNegative) { if (Value > 0) { Rectangle rect = new Rectangle(((int)(areaMarginX + firstPointX - lineInterval / 2)), (int)(areaHeight - firstPointY), (int)(lineInterval), (int)Math.Abs(Value)); BrushInfo interior = GetInteriorColumn(Value, sparkline, isNegative); rect.Y = rect.Y - (int)Math.Abs(Value); BrushPaint.FillRectangle(paint, rect, interior); } } else { lineRange = sparkline.HighPoint - sparkline.LowPoint; firstPointX = this.Sparkline.Location.X + lineInterval * k + (lineInterval / 2); firstPointY = this.Sparkline.Location.Y + (areaHeight * Value / lineRange); Rectangle rect = new Rectangle((int)(areaMarginX + firstPointX - lineInterval / 2 + sparkline.ColumnStyle.ColumnSpace), (int)(firstPointY + areaMarginY), (int)(lineInterval), (int)Math.Abs(Value)); BrushInfo interior = GetInteriorColumn(Value, sparkline, isNegative); BrushPaint.FillRectangle(paint, rect, interior); } } }
public Brush CreateBrush(bool swapColors) { if (!swapColors) { return(BrushInfo.CreateBrush(PrimaryColor.ToColor(), SecondaryColor.ToColor())); } else { return(BrushInfo.CreateBrush(SecondaryColor.ToColor(), PrimaryColor.ToColor())); } }
void lisBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ListBox listBox1 = sender as ListBox; BrushInfo curBrush = listBox1.SelectedItem as BrushInfo; if (curBrush == null) { return; } InnerBrush = curBrush.CurBrush; }
private void radioButton3_CheckedChanged(object sender, EventArgs e) { if (Hidden_Specific.Checked) { BrushInfo bi = new BrushInfo(GradientStyle.Vertical, this.colorPickerButton1.SelectedColor, this.colorPickerButton1.SelectedColor); this.chartControl1.Series[0].Style.DimmedInterior = new BrushInfo(Convert.ToInt16(this.numericUpDown1.Value), bi); BrushInfo bi1 = new BrushInfo(GradientStyle.Vertical, this.colorPickerButton1.SelectedColor, this.colorPickerButton1.SelectedColor); this.chartControl1.Series[1].Style.DimmedInterior = new BrushInfo(Convert.ToInt16(this.numericUpDown1.Value), bi1); BrushInfo bi2 = new BrushInfo(GradientStyle.Vertical, this.colorPickerButton1.SelectedColor, this.colorPickerButton1.SelectedColor); this.chartControl1.Series[2].Style.DimmedInterior = new BrushInfo(Convert.ToInt16(this.numericUpDown1.Value), bi2); } }
private void LoadBrush(object obj) { var brushManager = BaseServices.Get <BrushManager>(); var tls = brushManager.ThreadInfo; BrushInfo bInfo = (BrushInfo)(obj); tls.stream.Seek(index[bInfo.index], SeekOrigin.Begin); string name = (string)tls.formatter.Deserialize(tls.stream); GeometryMesh mesh = (GeometryMesh)tls.formatter.Deserialize(tls.stream); MakeBrush(name, mesh); }
public override void StartPaint(Transform StrokesContainer, BrushInfo BrushInf, float BrushWidth, Color color) { tempBrush = new GameObject(); tempBrush.transform.SetParent(StrokesContainer); MeshFilter meshFilter = tempBrush.AddComponent <MeshFilter>(); tempBrush.AddComponent <MeshRenderer>(); MeshCollider meshCollider = tempBrush.AddComponent <MeshCollider>(); meshCollider.sharedMesh = meshFilter.mesh; meshLineRenderer = tempBrush.AddComponent <MeshLineRenderer>(); meshLineRenderer.InitBrush(BrushInf, Camera.main.transform, BrushWidth, color); }
private void radioButton2_CheckedChanged(object sender, EventArgs e) { BrushInfo interior = this.chartControl1.Series[0].Style.HighlightInterior; if (interior == null) { interior = new BrushInfo(); } Color foreColor = interior.ForeColor; // Specifying a "Gold" highlight color. this.chartControl1.Series[0].Style.HighlightInterior = new BrushInfo(GradientStyle.None, foreColor, this.colorPickerButton1.SelectedColor); }
public BrushInfo GetBrushInfo(ToolBar bar, string patternOfProdID) { BrushInfo brushinfo = null; if (bar.State == EqpState.SETUP) { brushinfo = new BrushInfo(Color.Red); } else if (bar.State == EqpState.PM) { brushinfo = new BrushInfo(HatchStyle.Divot, Color.Black, Color.OrangeRed); } else if (bar.State == EqpState.DOWN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Gray, Color.Black); } else if (bar.IsGhostBar) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.LightGray, Color.White); } else { var color = ColorGenHelper.GetColorByKey(bar.ToolID, ColorGenHelper.CATETORY_MASK); //ColorGen.GetColor(bar.ToolID); if (bar.State == EqpState.IDLERUN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Black, color); } else { brushinfo = new BrushInfo(color); } } var selBar = this.SelectedBar; if (!this.EnableSelect || selBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!CompareToSelectedBar(bar, patternOfProdID)) { bar.BackColor = brushEmpth.BackColor; return(brushEmpth); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
private void ApplyBrush(BrushInfo brush) { Vector3 p = brush.transform.position; float rad = brush.transform.localScale.x * 0.5f; if (brush.circle) { Data.ApplyCircle(p.x, p.z, rad, CellSize); } else { Data.ApplyRectangle(p.x, p.z, rad, rad, CellSize); } }
private void radioButton2_CheckedChanged(object sender, EventArgs e) { if (radioButton2.Checked) { BrushInfo interior = this.chartControl1.Series[0].Style.HighlightInterior; if (interior == null) { interior = new BrushInfo(); } Color foreColor = interior.ForeColor; BrushInfo bi = new BrushInfo(GradientStyle.None, foreColor, this.colorPickerButton2.SelectedColor); this.chartControl1.Series[0].Style.HighlightInterior = new BrushInfo(Convert.ToInt16(this.numericUpDown1.Value), bi); } }
private void Color_Selected(object sender, System.EventArgs e) { BrushInfo interior = this.chartControl1.Series[0].Style.HighlightInterior; if (interior == null) { interior = new BrushInfo(); } if (this.radioButton2.Checked) { Color foreColor = interior.ForeColor; this.chartControl1.Series[0].Style.HighlightInterior = new BrushInfo(GradientStyle.None, foreColor, this.colorPickerButton1.SelectedColor); this.chartControl1.Refresh(); } }
public void applySimRepBrush(bool alternate) { if (TerrainGlobals.getEditor().getStrokeInputType() == BTerrainEditor.eEditorStrokeInput.cStrokeInputMouse) { //raycast and get our intersection Vector3 orig = TerrainGlobals.getEditor().getRayPosFromMouseCoords(false); Vector3 dir = TerrainGlobals.getEditor().getRayPosFromMouseCoords(true) - orig; dir = BMathLib.Normalize(dir); //get our intersect point if (!getClosestIntersectionPoint(new float3(orig), new float3(dir), out mLastMoustIntPt)) { return; } //If we're in tile mode, shift our center over to better match what our cursor is doing... if (TerrainGlobals.getEditor().getMode() == BTerrainEditor.eEditorMode.cModeSimBuildibility || TerrainGlobals.getEditor().getMode() == BTerrainEditor.eEditorMode.cModeSimPassibility || TerrainGlobals.getEditor().getMode() == BTerrainEditor.eEditorMode.cModeSimFloodPassibility || TerrainGlobals.getEditor().getMode() == BTerrainEditor.eEditorMode.cModeSimScarabPassibility) { mLastMoustIntPt.X += mTileScale; mLastMoustIntPt.Z += mTileScale; } // Undo info // addVertexUndoNodes(nodes, false); // Find affected points List <int> points = new List <int>(); getPointsIntersectingSphere(points, mLastMoustIntPt, TerrainGlobals.getEditor().mBrushInfo.mRadius); Vector3 intPoint = mLastMoustIntPt.toVec3(); Vector3 intNormal = BMathLib.unitY; BrushInfo bi = TerrainGlobals.getEditor().getCurrentBrushInfo(); ((BTerrainSimBrush)TerrainGlobals.getEditor().getCurrentBrush()).applyOnBrush(points, ref intPoint, ref intNormal, ref bi, alternate); // addVertexUndoNodes(nodes, true); } else if (TerrainGlobals.getEditor().getStrokeInputType() == BTerrainEditor.eEditorStrokeInput.cStrokeInputKeyboard) { BrushInfo bi = TerrainGlobals.getEditor().getCurrentBrushInfo(); ((BTerrainSimBrush)TerrainGlobals.getEditor().getCurrentBrush()).applyOnSelection(Masking.getCurrSelectionMaskWeights(), bi.mIntensity, alternate); } }
public void applyCameraRepBrush(bool alternate) { if (TerrainGlobals.getEditor().getStrokeInputType() == BTerrainEditor.eEditorStrokeInput.cStrokeInputMouse) { //raycast and get our intersection Vector3 orig = TerrainGlobals.getEditor().getRayPosFromMouseCoords(false); Vector3 dir = TerrainGlobals.getEditor().getRayPosFromMouseCoords(true) - orig; dir = BMathLib.Normalize(dir); //get our intersect point if (!getClosestIntersectionPoint(new float3(orig), new float3(dir), out mLastMoustIntPt)) { return; } // Undo info // addVertexUndoNodes(nodes, false); // Find affected points List <int> points = new List <int>(); getPointsIntersectingSphere(points, mLastMoustIntPt, TerrainGlobals.getEditor().mBrushInfo.mRadius); Vector3 intPoint = mLastMoustIntPt.toVec3(); Vector3 intNormal = BMathLib.unitY; BrushInfo bi = TerrainGlobals.getEditor().getCurrentBrushInfo(); ((BTerrainCameraBrush)TerrainGlobals.getEditor().getCurrentBrush()).applyOnBrush(points, ref intPoint, ref intNormal, ref bi, alternate); // addVertexUndoNodes(nodes, true); } else if (TerrainGlobals.getEditor().getStrokeInputType() == BTerrainEditor.eEditorStrokeInput.cStrokeInputKeyboard) { //int multiplier = 10; //// Apply on selection //List<BTerrainQuadNode> nodes = new List<BTerrainQuadNode>(); //TerrainGlobals.getTerrain().getQuadNodeRoot().getTileBoundsIntersection(nodes, Masking.mCurrSelectionMaskExtends.minX, Masking.mCurrSelectionMaskExtends.maxX, // Masking.mCurrSelectionMaskExtends.minZ, Masking.mCurrSelectionMaskExtends.maxZ); //((BTerrainFoliageBrush)mCurrBrush).applyOnSelection(Masking.getCurrSelectionMaskWeights(), this.mBrushInfo.mIntensity, // alternate || mCurrMode == eEditorMode.cModeFoliageErase); } }
private void DrawNoteBar(Graphics gr, BrushInfo brushInfo, Color frameColor, RectangleF rect) { rect.Inflate(_noteBarShapeInflateValue, _noteBarShapeInflateValue); if (frameColor != Color.Empty) { using (GraphicsPath framePath = GetShapePath(rect)) { gr.FillPath(new SolidBrush(frameColor), framePath); } rect.Inflate(-1, -1); } using (GraphicsPath path = GetShapePath(rect)) { gr.FillPath(brushInfo.GetBrush(Rectangle.Round(rect)), path); } }
public BrushInfo GetBrushInfo(GanttBar bar) { BrushInfo brushinfo = null; if (bar.State == EqpState.SETUP) { brushinfo = new BrushInfo(Color.Orange); } else if (bar.State == EqpState.PM) { brushinfo = new BrushInfo(Color.Red); } else if (bar.State == EqpState.DOWN) { brushinfo = new BrushInfo(HatchStyle.Percent30, Color.Gray, Color.Black); } else { brushinfo = new BrushInfo(GetColor(bar.BarKey)); } if (!this.EnableSelect || this.SelectedBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!this.IsSameTypeBar(bar)) { bar.BackColor = emptyBrush.BackColor; return(emptyBrush); } if (this.MouseSelectionType == MouseSelectionType.ProductID && bar.State == EqpState.SETUP && this.SelectedBar.State != EqpState.SETUP) { bar.BackColor = emptyBrush.BackColor; return(emptyBrush); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
public BrushInfo GetBrushInfo(GanttBar bar) { BrushInfo brushinfo = new BrushInfo(ColorGenHelper.GetColorByKey(bar.BarKey, ColorGenHelper.CATETORY_PRODUCT)); var selBar = this.SelectedBar; if (!this.EnableSelect || selBar == null) { bar.BackColor = brushinfo.BackColor; return(brushinfo); } if (!CompareToSelectedBar(bar)) { bar.BackColor = brushEmpth.BackColor; return(brushEmpth); } bar.BackColor = brushinfo.BackColor; return(brushinfo); }
protected override void DrawHeader(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle header_rect = this.GetHeaderRect(); Font font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);//, System.Drawing.GraphicsUnit.Point, ((byte)(0))); #region GradientBar appearance BrushInfo bf = new BrushInfo(GradientStyle.Vertical, color1); BrushPaint.FillRectangle(g, header_rect, bf); #endregion #region Set Image for Expander Rectangle rect = new Rectangle(this.ExpanderButton.Bounds.X - 10, this.ExpanderButton.Bounds.Y - 5, this.GetHeaderButtonSize().Height + 10, this.GetHeaderButtonSize().Width + 10); #region Embedding image as a resource Assembly asm = this.GetType().Assembly; Stream Xpand_str = asm.GetManifestResourceStream("TaskBar.Button-up.png"); Stream Collapse_str = asm.GetManifestResourceStream("TaskBar.Button-down.png"); #endregion if (this.Collapsed) { Image img = Image.FromStream(Collapse_str); g.DrawImage(img, rect); } else { Image img = Image.FromStream(Xpand_str); g.DrawImage(img, rect); } #endregion #region Border Pen pen = new Pen(Color.FromArgb(117, 135, 185), 3); g.DrawRectangle(pen, header_rect); #endregion #region Draw Text Brush bu = new SolidBrush(Color.White); g.DrawString(this.Text, font, bu, header_rect.X + 10, header_rect.Y + 5); #endregion }
public void LoadFrom(ToolEnvironment toolEnvironment) { this.textAlignment = toolEnvironment.textAlignment; this.gradientInfo = toolEnvironment.gradientInfo.Clone(); this.fontSmoothing = toolEnvironment.fontSmoothing; this.fontInfo = toolEnvironment.fontInfo.Clone(); this.penInfo = toolEnvironment.penInfo.Clone(); this.brushInfo = toolEnvironment.brushInfo.Clone(); this.primaryColor = toolEnvironment.primaryColor; this.secondaryColor = toolEnvironment.secondaryColor; this.alphaBlending = toolEnvironment.alphaBlending; this.shapeDrawType = toolEnvironment.shapeDrawType; this.antiAliasing = toolEnvironment.antiAliasing; this.colorPickerClickBehavior = toolEnvironment.colorPickerClickBehavior; this.resamplingAlgorithm = toolEnvironment.resamplingAlgorithm; this.tolerance = toolEnvironment.tolerance; this.selectionCombineMode = toolEnvironment.selectionCombineMode; this.floodMode = toolEnvironment.floodMode; this.selectionDrawModeInfo = toolEnvironment.selectionDrawModeInfo.Clone(); PerformAllChanged(); }