Esempio n. 1
0
 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 + "\";");
     }
 }
Esempio n. 2
0
 public void Rotate(float angle)
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Rotate(canvasID, angle);
     }
     else
     {
         SB_Append("ctx1.rotate(" + angle + ");");
     }
 }
Esempio n. 3
0
 public void Fill()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Fill(canvasID);
     }
     else
     {
         SB_Append("ctx1.fill();");
     }
 }
Esempio n. 4
0
 public void Stroke()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Stroke(canvasID);
     }
     else
     {
         SB_Append("ctx1.stroke();");
     }
 }
Esempio n. 5
0
 public void Begin_Path()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Begin_Path(canvasID);
     }
     else
     {
         SB_Append("ctx1.beginPath();");
     }
 }
Esempio n. 6
0
 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 + ");");
     }
 }
Esempio n. 7
0
 public void SaveState()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Save_State(canvasID);
     }
     else
     {
         SB_Append("ctx1.saveState();");
     }
 }
Esempio n. 8
0
 public void Translate(float x, float y)
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Translate(canvasID, x, y);
     }
     else
     {
         SB_Append("ctx1.translate(" + x + ", " + y + ");");
     }
 }
Esempio n. 9
0
 public void SetTransform()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Set_Transform(canvasID);
     }
     else
     {
         SB_Append(" ctx1.setTransform(1, 0, 0, 1, 0, 0);");
     }
 }
Esempio n. 10
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 + "\");");
     }
 }
Esempio n. 11
0
 public void RestoreState()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Restore_State(canvasID);
     }
     else
     {
         SB_Append("ctx1.restoreState();");
     }
 }
Esempio n. 12
0
 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 + "\");");
     }
 }
Esempio n. 13
0
 public void RenderToUI()
 {
     if (_JsInteropExecutionMode == 0)
     {
         BCCCJsInterop.Render_To_UI(canvasID);
     }
     else
     {
         SB_Append("ctx(\"" + canvasID + "\", true).drawImage(ctx1.canvas, 0, 0);");
     }
 }
Esempio n. 14
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);");
     }
 }
Esempio n. 15
0
 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);");
     }
 }
Esempio n. 16
0
 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 + ");");
     }
 }
Esempio n. 17
0
 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 + ");");
     }
 }
Esempio n. 18
0
 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 + ");");
     }
 }
Esempio n. 19
0
 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 + ");");
     }
 }
Esempio n. 20
0
 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;");
         }
     }
 }
Esempio n. 21
0
        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());
 }
Esempio n. 23
0
 public void SB_Execute()
 {
     BCCCJsInterop.Execute_Dynamic_Script(sb.ToString());
     SB_Clear();
 }
Esempio n. 24
0
 public void Log_Canvas_Array()
 {
     BCCCJsInterop.Log_Canvas_Array();
 }
Esempio n. 25
0
 public void Remove_Canvas()
 {
     BCCCJsInterop.Remove_Canvas(FgCanvasID);
 }
Esempio n. 26
0
 public void Add_Canvas()
 {
     BCCCJsInterop.Add_Canvas(FgCanvasID, BgCanvasID, TopCanvasID);
 }