public void SetProperty(TransferCanvasProperty transferCanvasProperty) { if (_JsInteropExecutionMode == 0) { string key = canvasID + transferCanvasProperty.propertyName; string value = string.Empty; if (PropertiesDictionary.TryGetValue(canvasID + transferCanvasProperty.propertyName, out value)) { if (!value.Equals(transferCanvasProperty.propertyValue, StringComparison.InvariantCultureIgnoreCase)) { PropertiesDictionary[key] = transferCanvasProperty.propertyValue; BCCCJsInterop.Set_Property(canvasID, transferCanvasProperty); } } else { PropertiesDictionary.Add(key, transferCanvasProperty.propertyValue); BCCCJsInterop.Set_Property(canvasID, transferCanvasProperty); } } else { SB_Append("ctx1[\"" + transferCanvasProperty.propertyName + "\"] = \"" + transferCanvasProperty.propertyValue + "\";"); } }
public void Rotate(float angle) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Rotate(canvasID, angle); } else { SB_Append("ctx1.rotate(" + angle + ");"); } }
public void Fill() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Fill(canvasID); } else { SB_Append("ctx1.fill();"); } }
public void Stroke() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Stroke(canvasID); } else { SB_Append("ctx1.stroke();"); } }
public void Begin_Path() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Begin_Path(canvasID); } else { SB_Append("ctx1.beginPath();"); } }
public void Fill_Text(TransferFillTextParameters transferFillTextParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Fill_Text(canvasID, transferFillTextParameters); } else { SB_Append("ctx1.fillText(\"" + transferFillTextParameters.text + "\"," + transferFillTextParameters.x + "," + transferFillTextParameters.y + ");"); } }
public void SaveState() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Save_State(canvasID); } else { SB_Append("ctx1.saveState();"); } }
public void Translate(float x, float y) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Translate(canvasID, x, y); } else { SB_Append("ctx1.translate(" + x + ", " + y + ");"); } }
public void SetTransform() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Set_Transform(canvasID); } else { SB_Append(" ctx1.setTransform(1, 0, 0, 1, 0, 0);"); } }
public void Move_To(float x, float y) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Move_To(canvasID, x, y); } else { SB_Append("ctx1.moveTo(\"" + x + "\", \"" + y + "\");"); } }
public void RestoreState() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Restore_State(canvasID); } else { SB_Append("ctx1.restoreState();"); } }
public void GradientAddColorStop(double stop, string color) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Gradient_Add_Color_Stop((float)stop, color); } else { SB_Append(" grad.addColorStop(" + stop + ", \"" + color + "\");"); } }
public void RenderToUI() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Render_To_UI(canvasID); } else { SB_Append("ctx(\"" + canvasID + "\", true).drawImage(ctx1.canvas, 0, 0);"); } }
public void ClearCanvas() { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Clear_Canvas(canvasID); } else { SB_Append(" ctx1.setTransform(1, 0, 0, 1, 0, 0);"); SB_Append(" ctx1.clearRect(0, 0, ctx1.canvas.clientWidth, ctx1.canvas.clientHeight);"); } }
public void DrawFullSizeRect(string color) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Draw_Full_Size_Rect(canvasID, color); } else { SB_Append(" ctx1.beginPath();"); SB_Append(" ctx1.fillStyle = \"" + color + "\";"); SB_Append(" ctx1.fillRect(0, 0, ctx1.canvas.clientWidth, ctx1.canvas.clientHeight);"); } }
public void Draw_Image(string imgName, TransferImageParameters transferImageParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Draw_Image(canvasID, imgName, transferImageParameters); } else { SB_Append(" ctx1.drawImage(img_Corner_Shape," + transferImageParameters.x + "," + transferImageParameters.y + "," + transferImageParameters.width + "," + transferImageParameters.height + ");"); } }
public void StrokeRect(TransferRectParameters transferRectParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Stroke_Rect(canvasID, transferRectParameters); } else { SB_Append("ctx1.strokeRect(" + transferRectParameters.x + "," + transferRectParameters.y + "," + transferRectParameters.w + "," + transferRectParameters.h + ");"); } }
public void FillCircle(TransferParameters transferParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Draw_Circle(canvasID, transferParameters); } else { SB_Append(" ctx1.arc(" + transferParameters.x + ", " + transferParameters.y + ", " + transferParameters.r + ", " + transferParameters.sAngle + ", " + transferParameters.eAngle + ");"); } }
public void CreateRadialGradient(TransferRadialGradientParameters transferRadialGradientParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Create_Radial_Gradient(canvasID, transferRadialGradientParameters); } else { SB_Append(" grad = ctx1.createRadialGradient(" + transferRadialGradientParameters.x0 + ", " + transferRadialGradientParameters.y0 + ", " + transferRadialGradientParameters.r0 + ", " + transferRadialGradientParameters.x1 + ", " + transferRadialGradientParameters.y1 + ", " + transferRadialGradientParameters.r1 + ");"); } }
public void GradientSetStokeOrFillStyle(bool StrokeOrFill) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Gradient_Set_Stoke_Or_Fill_Style(canvasID, StrokeOrFill); } else { if (StrokeOrFill) { SB_Append(" ctx1.strokeStyle = grad;"); } else { SB_Append(" ctx1.fillStyle = grad;"); } } }
public void FillGauge(string color, TransferParameters transferParameters) { if (_JsInteropExecutionMode == 0) { BCCCJsInterop.Draw_Gauge(canvasID, color, transferParameters); } else { SB_Append(" var gradient = ctx1.createRadialGradient(0, 0, 0, 0, 0, " + transferParameters.r + ");"); SB_Append(" gradient.addColorStop(0, 'white');"); SB_Append(" gradient.addColorStop(1, \"" + color + "\");"); SB_Append(" ctx1.beginPath();"); SB_Append(" ctx1.moveTo(0, 0);"); SB_Append(" ctx1.arc(" + transferParameters.x + ", " + transferParameters.y + ", " + transferParameters.r + ", " + transferParameters.sAngle + ", " + transferParameters.eAngle + ");"); SB_Append(" ctx1.fillStyle = gradient;"); SB_Append(" ctx1.closePath();"); SB_Append(" ctx1.fill();"); } }
async Task <string> Preload_Image() { return(await BCCCJsInterop.Preload_Image()); }
public void SB_Execute() { BCCCJsInterop.Execute_Dynamic_Script(sb.ToString()); SB_Clear(); }
public void Log_Canvas_Array() { BCCCJsInterop.Log_Canvas_Array(); }
public void Remove_Canvas() { BCCCJsInterop.Remove_Canvas(FgCanvasID); }
public void Add_Canvas() { BCCCJsInterop.Add_Canvas(FgCanvasID, BgCanvasID, TopCanvasID); }