public StrokeDto(StrokeData strokeData) { Id = strokeData.Id; Path = strokeData.Path; Brush = strokeData.Color; Size = strokeData.Size; }
public override void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Coordinates", Coordinates); info.AddValue("PenThikness", PenThikness); info.AddValue("Color", Color.ToString()); info.AddValue("BrushColor", BrushColor.ToString()); info.AddValue("Dash", DashString); }
public EdgeDraw(BrushColor brushEdge, int weightEdge, int id, int connectableVertex) { BrushEdge = brushEdge; Id = id; ConnectabelVertex = connectableVertex; }
public void SetBackgroundColor(BrushColor newColor) { if (BackgroundColor != newColor) { BackgroundColor = newColor; OnChanged.SafeInvoke(this); } }
public TextElement(Note owner, Vector2 position, int fontSize, BrushColor color) { Id = Guid.NewGuid(); Owner = owner; Position = position; FontSize = fontSize; Color = color; }
public Note(string name) { Id = Guid.NewGuid(); Name = new NoteName(name, string.Empty, DateTime.Now, DateTime.Now, DateTime.Now); TextElements = new TextElement[] { }; LineElements = new LineElement[] { }; Strokes = new Stroke[] { }; BackgroundColor = new BrushColor(1, 1, 1, 1); }
public Stroke(Note owner, BrushColor color, BrushSize size, Vector2[] path) { Id = Guid.NewGuid(); Owner = owner; Color = color; Size = size; Path = path; }
public LineElement(Note owner, Vector2 start, Vector2 end, BrushColor color, BrushSize size) { Id = Guid.NewGuid(); Owner = owner; StartPosition = start; EndPosition = end; Color = color; Size = size; }
void OnGUI() { if (bshow) { //GUI.DrawTexture(new Rect(Screen.width/2, Screen.height * 0.07f, Screen.width/2,Screen.height*0.9f),texRender,ScaleMode.StretchToFill); GUI.DrawTexture(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height), texRender, ScaleMode.StretchToFill); //点击save截图 if (GUI.Button(new Rect(660 * m_fScaleWidth, 750 * m_fScaleHeight, 90 * m_fScaleWidth, 40 * m_fScaleHeight), "Save")) { rect = new Rect(Screen.width * 0.51f, Screen.height * 0.07f, Screen.width * 0.49f, Screen.height * 0.88f); CaptureScreenshot2(rect); text.text = "Saved successfully!"; } // Btn.onClick.AddListener(delegate () //{ // rect = new Rect(Screen.width * 0.51f, Screen.height * 0.07f, Screen.width * 0.49f, Screen.height * 0.88f); // CaptureScreenshot2(rect); // text.text = "Saved successfully!"; //}); } if (GUI.Button(new Rect(0, 80, 100, 40), "clear")) { Clear(texRender); } if (GUI.Button(new Rect(100, 80, 100, 40), "draw")) { bshow = !bshow; isDraw = !isDraw; } int width = Screen.width / (int)BrushColor.count; for (int i = 0; i < (int)BrushColor.count; i++) { if (GUI.Button(new Rect(i * width, 0, width, 30), Enum.GetName(typeof(BrushColor), i))) { brushColorType = (BrushColor)i; } } GUI.Label(new Rect(0, 130, 300, 30), "brushScale : " + brushScale.ToString("F2")); brushScale = (int)GUI.HorizontalSlider(new Rect(120, 135, 200, 30), brushScale * 10.0f, 1, 50) / 10.0f; if (brushScale < 0.1f) { brushScale = 0.1f; } }
void OnGUI() { GUIStyle gUIStyle = new GUIStyle(); // gUIStyle.fontSize = 25; // gUIStyle.normal.textColor = Color.black; if (bshow) { //GUI.DrawTexture(new Rect(Screen.width/2, Screen.height * 0.07f, Screen.width/2,Screen.height*0.9f),texRender,ScaleMode.StretchToFill); GUI.DrawTexture(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height), texRender, ScaleMode.StretchToFill); //点击save截图 if (GUI.Button(new Rect(660 * m_fScaleWidth, 750 * m_fScaleHeight, 90 * m_fScaleWidth, 40 * m_fScaleHeight), "Save")) { rect = new Rect(Screen.width * 0.51f, Screen.height * 0.07f, Screen.width * 0.49f, Screen.height * 0.88f); CaptureScreenshot2(rect); text.text = "Saved!"; } if (GUI.Button(new Rect(100, 80, 100, 40), "clear")) { Clear(texRender); } int width = Screen.width / (int)BrushColor.count; for (int i = 0; i < (int)BrushColor.count; i++) { if (GUI.Button(new Rect(i * width, 0, width, 30), Enum.GetName(typeof(BrushColor), i))) { brushColorType = (BrushColor)i; } } GUI.Label(new Rect(0, 130, 300, 30), "brushScale : " + brushScale.ToString("F2")); brushScale = (int)GUI.HorizontalSlider(new Rect(120, 135, 200, 30), brushScale * 10.0f, 1, 50) / 10.0f; if (brushScale < 0.1f) { brushScale = 0.1f; } } if (GUI.Button(new Rect(0, 80, 100, 40), "Draw")) { bshow = !bshow; isDraw = !isDraw; ga.SetActive(true); } }
private void ChangeColorEdges(BrushColor color, List <int> cycle) { for (int i = 0; i < cycle.Count - 1; i++) { for (int j = 0; j < edgeDraws.Count; j++) { if (edgeDraws[j].Id == cycle[i] && edgeDraws[j].ConnectabelVertex == cycle[i + 1]) { edgeDraws[j].BrushEdge = color; } } } }
public void APP_Color() { System.Windows.Media.Brush b = BrushColor.GetBursh(); if (b != null) { serverNameTextBlock.Background = b; serverPeopleTextBlock.Background = b; serverVersionTextBlock.Background = b; serverPingTextBlock.Background = b; serverMotdTextBlock.Background = b; serverModsTextBlock.Background = b; } }
public Stroke AddStroke(BrushColor color, BrushSize size, Vector2[] path) { if (color != null && size != null && path != null && path.Length > 1) { var stroke = new Stroke(this, color, size, path); #warning change concat addition to lists eventually Strokes = Strokes.Concat(new Stroke[] { stroke }).ToArray(); OnChanged.SafeInvoke(this); return(stroke); } else { throw new ArgumentException("AddStroke input arguments are not valid"); } }
public LineElement AddLine(Vector2 start, Vector2 end, BrushSize size, BrushColor color) { if (start != null && end != null && size != null && color != null) { var line = new LineElement(this, start, end, color, size); #warning change concat addition to lists eventually LineElements = LineElements.Concat(new LineElement[] { line }).ToArray(); OnChanged.SafeInvoke(this); return(line); } else { throw new ArgumentException("AddLine input arguments not valid"); } }
public TextElement AddText(string text, int size, BrushColor color, Vector2 position) { if (!string.IsNullOrWhiteSpace(text) && size > 0 && color != null) { var element = new TextElement(this, position, size, color); #warning change concat addition to lists eventually TextElements = TextElements.Concat(new TextElement[] { element }).ToArray(); OnChanged.SafeInvoke(this); return(element); } else { throw new ArgumentException("AddText input arguments not valid"); } }
// Предоставляет данные об кисти. public virtual void GetInfo() { // Устанавливаем старый цвет консоли во временное хранилище. ConsoleColor TempColor = Console.ForegroundColor; // Устанавливаем цвет текста консоли для печатаемого далее текста. Console.ForegroundColor = this.BrushColor; // Печатаем текст информации о кисти. Console.Write("Цвет: " + BrushColor.ToString() + "; "); Console.WriteLine("Размер кисти: " + BrushSize.ToString()); //Возвращаем старый цвет текста консоли. Console.ForegroundColor = TempColor; }
private void ChangeColorEdges(BrushColor color) { if (path != null) { for (int i = 0; i < path.Count - 1; i++) { for (int j = 0; j < edgeDraws.Count; j++) { if (edgeDraws[j].Id == path[i] && edgeDraws[j].ConnectabelVertex == path[i + 1]) { edgeDraws[j].BrushEdge = color; } } } } }
public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("ShapeId", ShapeId); info.AddValue("CurrentShape", CurrentShape); info.AddValue("BrushType", BrushType); info.AddValue("PenType", PenType); info.AddValue("Width", ShapeSize.Width); info.AddValue("Height", ShapeSize.Height); info.AddValue("X", ShapeLoc.X); info.AddValue("Y", ShapeLoc.Y); info.AddValue("PenColor", PenColor.ToArgb()); info.AddValue("BrushColor", BrushColor.ToArgb()); info.AddValue("IsBrush", IsBrush); }
public VertexDraw(BrushColor brushCircle, BrushColor textBrush, float x, float y, float width, float height, string text, int id) { BrushCircle = brushCircle; TextBrush = textBrush; X = x; Y = y; Width = width; Height = height; Text = text; Id = id; }
private Color GetColor(BrushColor color) { switch (color) { case BrushColor.Black: return(Color.Black); case BrushColor.Green: return(Color.Green); case BrushColor.Orange: return(Color.Red); case BrushColor.Yellow: return(Color.Yellow); default: return(Color.White); } }
public LineElementDto AddLine(Guid noteId, [FromBody] NewLineElementInput input) { var user = AuthorizationHelper.GetAuthorizedUser(); var note = user?.Notes.FirstOrDefault(n => n.Id == noteId); if (note == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } var color = new BrushColor(input.R, input.B, input.G, input.A) { }; var size = new BrushSize(input.Radius) { }; var line = note.AddLine(input.Start, input.End, size, color); return(new LineElementDto(line.ToData())); }
void ReleaseDesignerOutlets() { if (BrushColor != null) { BrushColor.Dispose(); BrushColor = null; } if (BrushSize != null) { BrushSize.Dispose(); BrushSize = null; } if (ClearBT != null) { ClearBT.Dispose(); ClearBT = null; } if (DrawView != null) { DrawView.Dispose(); DrawView = null; } if (infoBrushSize != null) { infoBrushSize.Dispose(); infoBrushSize = null; } if (undoBT != null) { undoBT.Dispose(); undoBT = null; } }
private void Pcolor_MouseClick(object sender, MouseEventArgs e) { BrushColor.ShowDialog(); Pcolor.BackColor = BrushColor.Color; myColor = BrushColor.Color; }
get => new Pen(BrushColor, BrushSize);
public void SaveInXML(XmlElement parentNode, CandleChartControl owner) { var node = parentNode.AppendChild(parentNode.OwnerDocument.CreateElement("Ellipse")); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("name")).Value = Name; node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("color")).Value = Color.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("brushColor")).Value = BrushColor.ToArgb().ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("brushAlpha")).Value = BrushAlpha.ToString(); node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("BuildTangent")).Value = BuildTangent.ToString(); for (int i = 0; i < points.Count; i++) { var nodePoint = node.AppendChild(parentNode.OwnerDocument.CreateElement(string.Format("point{0}", i))); var time = owner.chart.StockSeries.GetCandleOpenTimeByIndex((int)Math.Round(points[i].X)); nodePoint.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("time")).Value = time.ToString("ddMMyyyy HHmmss", CultureProvider.Common); nodePoint.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("price")).Value = points[i].Y.ToString(CultureProvider.Common); } }