2 using System.Windows;
\r
3 using System.Windows.Controls;
\r
4 using System.Windows.Documents;
\r
5 using System.Windows.Input;
\r
6 using System.Windows.Media;
\r
7 using System.Windows.Media.Animation;
\r
8 using System.Windows.Media.Imaging;
\r
9 using System.Windows.Shapes;
\r
10 using System.Windows.Browser;
\r
20 public class StackableDrawable : Drawable
\r
22 // protected System.Collections.Generic.Queue<Internal.PrimitiveFigure> stack;
\r
23 internal Internal.PrimitiveFigure[] stack;
\r
24 internal int stackN;
\r
25 internal Line[] lineStack;
\r
26 internal int lineStackN;
\r
27 internal Rectangle[] rectStack;
\r
28 internal int rectStackN;
\r
29 internal Ellipse[] ellipseStack;
\r
30 internal int ellipseStackN;
\r
31 internal Polygon[] polygonStack;
\r
32 internal int polygonStackN;
\r
33 internal Letters[] lettersStack;
\r
34 internal int lettersStackN;
\r
35 internal Image[] imageStack;
\r
36 internal int imageStackN;
\r
39 public StackableDrawable()
\r
41 // stack = new System.Collections.Generic.Queue<Internal.PrimitiveFigure>();
\r
42 stack = new Internal.PrimitiveFigure[40000];
\r
43 lineStack = new Line[10000];
\r
44 rectStack = new Rectangle[10000];
\r
45 ellipseStack = new Ellipse[10000];
\r
46 polygonStack = new Polygon[1000];
\r
47 lettersStack = new Letters[1000];
\r
48 imageStack = new Image[1000];
\r
49 for (int i = 0; i < 10000; i++)
\r
51 lineStack[i] = new Line(0,0,0,0);
\r
52 rectStack[i] = new Rectangle();
\r
53 ellipseStack[i] = new Ellipse();
\r
55 for (int i = 0; i < 1000; i++)
\r
57 polygonStack[i] = new Polygon();
\r
58 lettersStack[i] = new Letters();
\r
59 imageStack[i] = new Image(1,1);
\r
67 public virtual void clear(Color col)
\r
69 //rect(back_panel, col);
\r
72 public virtual void pix(int x, int y, Color col)
\r
76 public virtual void line(Line drawee)
\r
78 // stack.Enqueue(drawee.clone());
\r
79 drawee.copyToStack(this);
\r
82 public virtual void rect(Rectangle drawee)
\r
84 //stack.Enqueue(drawee.clone());
\r
85 // stack.Enqueue(drawee.copyToStack(this));
\r
86 drawee.copyToStack(this);
\r
89 public virtual void ellipse(Ellipse drawee)
\r
91 // stack.Enqueue(drawee.clone());
\r
92 drawee.copyToStack(this);
\r
95 public virtual void polygon(Polygon drawee)
\r
97 // stack.Enqueue(drawee.clone());
\r
98 drawee.copyToStack(this);
\r
101 public virtual void letters(Letters drawee)
\r
103 // stack.Enqueue(drawee.clone());
\r
104 drawee.copyToStack(this);
\r
107 public virtual void image(Image drawee)
\r
109 // stack.Enqueue(drawee.clone());
\r
110 drawee.copyToStack(this);
\r
113 public void msg(string str, double x, double y) { msg(str, x, y, Color.white); }
\r
114 public virtual void msg(string dstr, double x, double y, Color col)
\r
116 var let = new Letters(dstr);
\r
121 public void var<Type>(Type val, double x, double y) { msg(val.ToString(), x, y, Color.white); }
\r
122 public void var<Type>(Type val, double x, double y, Color col) { msg(val.ToString(), x, y, col); }
\r
124 public virtual Point getCenter() { return new Point(0, 0, 0); }
\r
129 public class Canvas : Templates.StackableDrawable
\r
132 internal System.Windows.Controls.Canvas masterPool, prevPool;
\r
133 internal System.Windows.Point[] pointPool;
\r
134 internal int pointPoolN;
\r
135 internal SolidColorBrush[] brushPool;
\r
136 internal int brushPoolN;
\r
137 internal System.Windows.Shapes.Line[] linePool;
\r
138 internal int linePoolN;
\r
139 internal System.Windows.Shapes.Rectangle[] rectPool;
\r
140 internal int rectPoolN;
\r
141 internal System.Windows.Shapes.Ellipse[] ellipsePool;
\r
142 internal int ellipsePoolN;
\r
143 internal System.Windows.Shapes.Polygon[] polygonPool;
\r
144 internal int polygonPoolN;
\r
145 internal System.Windows.Controls.TextBlock[] lettersPool;
\r
146 internal int lettersPoolN;
\r
147 internal System.Windows.Controls.Image[] imagePool;
\r
148 internal int imagePoolN;
\r
150 #region initializer
\r
152 internal delegate void TwoIntProcedure(int x, int y);
\r
153 internal delegate void SimpleProcedure();
\r
154 SimpleProcedure flipexec;
\r
156 //public static System.Windows.Controls.Image default_buffer_frame;
\r
157 public static System.Windows.Controls.UserControl default_panel;
\r
158 public static System.Windows.Controls.Canvas default_api_canvas;
\r
159 public static WriteableBitmap default_buffer;
\r
160 //WriteableBitmap buffer;
\r
161 //System.Windows.Controls.Image instance;
\r
162 System.Windows.Controls.Canvas api_canvas;
\r
163 System.Windows.Controls.UserControl panel;
\r
164 Rectangle back_panel;
\r
165 double width_, height_;
\r
167 public Canvas(int wid, int hei)
\r
169 panel = default_panel;
\r
170 api_canvas = default_api_canvas;
\r
171 initialize(wid, hei);
\r
173 public Canvas(int wid, int hei, System.Windows.Controls.Canvas apicnvs, System.Windows.Controls.UserControl system)
\r
176 api_canvas = apicnvs;
\r
177 initialize(wid, hei);
\r
180 protected bool AsyncInitBool;
\r
181 protected void initialize(int wid, int hei)
\r
183 AsyncInitBool = false;
\r
186 api_canvas.Dispatcher.BeginInvoke(new TwoIntProcedure(initialize__), wid, hei);
\r
187 //while(!AsyncInitBool)
\r
190 Mouse._prime = api_canvas;
\r
191 Main.drawable = this;
\r
192 Main.canvas = this;
\r
194 back_panel = new Rectangle(wid, hei);
\r
196 flipexec = new SimpleProcedure(executeFlip);
\r
198 protected void initialize__(int wid, int hei)
\r
200 api_canvas.Width = wid;
\r
201 api_canvas.Height = hei;
\r
202 api_canvas.MouseMove += Mouse.Canvas_MousePos;
\r
203 api_canvas.MouseLeftButtonDown += Mouse.Canvas_LDown;
\r
204 api_canvas.MouseLeftButtonUp += Mouse.Canvas_LUp;
\r
205 api_canvas.MouseWheel += Mouse.Canvas_MouseWheel;
\r
206 panel.KeyDown += Keyboard.Canvas_KeyDown;
\r
207 panel.KeyUp += Keyboard.Canvas_KeyUp;
\r
209 HtmlElement htmlHost = HtmlPage.Document.GetElementById("silverlightControlHost");
\r
210 //if (htmlHost != null) HtmlPage.Window.Alert("silverlightControlHost is null");
\r
211 htmlHost.SetStyleAttribute("width", (wid).ToString()+"px");
\r
212 htmlHost.SetStyleAttribute("height", (20+hei).ToString() + "px");
\r
213 htmlHost.SetStyleAttribute("margin", "2em auto auto auto");
\r
216 pointPool = new System.Windows.Point[10000];
\r
217 brushPool = new SolidColorBrush[10000];
\r
218 linePool = new System.Windows.Shapes.Line[10000];
\r
219 rectPool = new System.Windows.Shapes.Rectangle[10000];
\r
220 ellipsePool = new System.Windows.Shapes.Ellipse[10000];
\r
221 for (int i = 0; i < 10000; i++)
\r
223 pointPool[i] = new System.Windows.Point();
\r
224 brushPool[i] = new SolidColorBrush();
\r
225 linePool[i] = new System.Windows.Shapes.Line();
\r
226 rectPool[i] = new System.Windows.Shapes.Rectangle();
\r
227 ellipsePool[i] = new System.Windows.Shapes.Ellipse();
\r
229 polygonPool = new System.Windows.Shapes.Polygon[1000];
\r
230 lettersPool = new System.Windows.Controls.TextBlock[1000];
\r
231 for (int i = 0; i < 1000; i++)
\r
233 polygonPool[i] = new System.Windows.Shapes.Polygon();
\r
234 lettersPool[i] = new System.Windows.Controls.TextBlock();
\r
237 imagePool = new System.Windows.Controls.Image[100];
\r
238 for (int i = 0; i < 100; i++)
\r
240 imagePool[i] = new System.Windows.Controls.Image();
\r
244 masterPool = new System.Windows.Controls.Canvas();
\r
245 prevPool = new System.Windows.Controls.Canvas();
\r
246 api_canvas.Children.Add(masterPool);
\r
247 //api_canvas.Children.Remove(Internal.Main.widgetStack);
\r
249 AsyncInitBool = true;
\r
254 #region static initializer
\r
256 static System.Windows.Shapes.Line api_line;
\r
257 static System.Windows.Shapes.Path api_curve;
\r
258 static System.Windows.Shapes.Rectangle api_rect;
\r
259 static System.Windows.Shapes.Ellipse api_ellipse;
\r
260 static System.Windows.Shapes.Polygon api_polygon;
\r
261 static System.Windows.Shapes.Polyline api_polyline;
\r
262 static System.Windows.Media.Color api_color;
\r
263 static System.Windows.Media.SolidColorBrush api_fill;
\r
264 static System.Windows.Media.SolidColorBrush api_stroke;
\r
265 static System.Windows.Media.TranslateTransform api_translation;
\r
268 api_line = new System.Windows.Shapes.Line();
\r
269 api_curve = new System.Windows.Shapes.Path();
\r
270 api_rect = new System.Windows.Shapes.Rectangle();
\r
271 api_ellipse = new System.Windows.Shapes.Ellipse();
\r
272 api_polygon = new System.Windows.Shapes.Polygon();
\r
273 api_polyline = new System.Windows.Shapes.Polyline();
\r
274 api_color = new System.Windows.Media.Color();
\r
275 api_fill = new System.Windows.Media.SolidColorBrush();
\r
276 api_stroke = new System.Windows.Media.SolidColorBrush();
\r
277 api_translation = new System.Windows.Media.TranslateTransform();
\r
283 public override void clear(Color col)
\r
285 back_panel.fill = col;
\r
290 int nextIntervalFrame = 1, chacked = 0;
\r
291 public void flip(int n)
\r
299 nextIntervalFrame = 1;
\r
322 Internal.Main.canvas_flag.WaitOne();
\r
324 public void executeFlip()
\r
328 nextIntervalFrame--;
\r
330 if (nextIntervalFrame <= 0)
\r
334 masterPool.Children.Clear();
\r
337 for (int i = 0; i < stackN - 2; i++)
\r
339 masterPool.Children.Add(stack[i].poolNative(this));
\r
347 Psychlops.Internal.Main.canvas_flag.Set();
\r
350 System.Threading.Thread.Sleep(0);
\r
357 public double width { get { return width_; } }
\r
358 public double height { get { return height_; } }
\r
359 public Point center { get { return new Point(width / 2.0, height / 2.0, 0); } }
\r
360 public double getWidth() { return width; }
\r
361 public double getHeight() { return height; }
\r
362 public override Point getCenter() { return center; }
\r
363 public double getHCenter() { return width / 2; }
\r
364 public double getVCenter() { return height / 2; }
\r
365 public double getRefreshRate() { return 60; }
\r
374 #region primitive tokenizer
\r
376 partial struct Point
\r
378 public static implicit operator System.Windows.Point(Point d)
\r
380 return new System.Windows.Point(d.x, d.y);
\r
384 partial struct Color
\r
386 public static implicit operator System.Windows.Media.Color(Color d)
\r
388 return System.Windows.Media.Color.FromArgb((byte)(d.a * 255), (byte)(d.r * 255), (byte)(d.g * 255), (byte)(d.b * 255));
\r
390 public static implicit operator System.Windows.Media.SolidColorBrush(Color d)
\r
392 return new SolidColorBrush { Color = d };
\r
396 partial struct Stroke
\r
398 public void apply(System.Windows.Shapes.Shape target)
\r
400 target.Stroke = this;
\r
401 //target.StrokeDashArray
\r
402 target.StrokeThickness = thick;
\r
404 public static implicit operator SolidColorBrush(Stroke d)
\r
406 return new SolidColorBrush { Color = d.color };
\r
414 return (Line)MemberwiseClone();
\r
416 public Line clone()
\r
418 return (Line)MemberwiseClone();
\r
420 public static implicit operator System.Windows.Shapes.Line(Line d)
\r
422 var tmp = new System.Windows.Shapes.Line() { X1 = d.begin.x, Y1 = d.begin.y, X2 = d.end.x, Y2 = d.end.y };
\r
423 if (d.stroke.thick == 0.0) tmp.Stroke = d.fill;
\r
424 else d.stroke.apply(tmp);
\r
427 public UIElement toNative() { return this; }
\r
429 public void copyToStack(Templates.StackableDrawable d)
\r
431 var tmp = d.lineStack[d.lineStackN];
\r
432 tmp.begin.x = begin.x;
\r
433 tmp.begin.y = begin.y;
\r
437 tmp.stroke = stroke;
\r
438 d.stack[d.stackN] = tmp;
\r
442 public UIElement poolNative(Canvas d)
\r
444 var tmp = d.linePool[d.linePoolN];
\r
449 if (stroke.thick == 0.0) tmp.Stroke = fill;
\r
450 else stroke.apply(tmp);
\r
451 System.Windows.Controls.Canvas.SetLeft(tmp, left);
\r
452 System.Windows.Controls.Canvas.SetTop(tmp, top);
\r
453 tmp.Visibility = Visibility.Visible;
\r
459 partial class Rectangle
\r
461 public Rectangle dup()
\r
463 return (Rectangle)MemberwiseClone();
\r
465 public Rectangle clone()
\r
467 return (Rectangle)MemberwiseClone();
\r
469 public static implicit operator System.Windows.Rect(Rectangle d)
\r
471 return new System.Windows.Rect(d.v1.x, d.v1.y, d.v2.x, d.v2.y);
\r
473 public static implicit operator System.Windows.Shapes.Rectangle(Rectangle d)
\r
475 var tmp = new System.Windows.Shapes.Rectangle { Width = d.width, Height = d.height, Fill = d.fill };
\r
476 d.stroke.apply(tmp);
\r
477 System.Windows.Controls.Canvas.SetLeft(tmp, d.left);
\r
478 System.Windows.Controls.Canvas.SetTop(tmp, d.top);
\r
482 public UIElement toNative() { return this; }
\r
483 public void copyToStack(Templates.StackableDrawable d)
\r
485 var tmp = d.rectStack[d.rectStackN];
\r
489 d.stack[d.stackN] = tmp;
\r
493 public UIElement poolNative(Canvas d)
\r
495 var tmp = d.rectPool[d.rectPoolN];
\r
497 tmp.Height = height;
\r
499 System.Windows.Controls.Canvas.SetLeft(tmp, left);
\r
500 System.Windows.Controls.Canvas.SetTop(tmp, top);
\r
501 tmp.Visibility = Visibility.Visible;
\r
507 partial class Ellipse
\r
509 public Ellipse dup()
\r
511 return (Ellipse)MemberwiseClone();
\r
513 public Ellipse clone()
\r
515 return (Ellipse)MemberwiseClone();
\r
517 public static implicit operator System.Windows.Shapes.Ellipse(Ellipse d)
\r
519 var tmp = new System.Windows.Shapes.Ellipse { Width = d.width, Height = d.height, Fill = d.fill };
\r
520 d.stroke.apply(tmp);
\r
521 System.Windows.Controls.Canvas.SetLeft(tmp, d.left);
\r
522 System.Windows.Controls.Canvas.SetTop(tmp, d.top);
\r
526 public UIElement toNative() { return this; }
\r
528 public void copyToStack(Templates.StackableDrawable d)
\r
530 var tmp = d.ellipseStack[d.ellipseStackN];
\r
532 tmp.xdiameter = xdiameter;
\r
533 tmp.ydiameter = ydiameter;
\r
535 d.stack[d.stackN] = tmp;
\r
539 public UIElement poolNative(Canvas d)
\r
541 var tmp = d.ellipsePool[d.ellipsePoolN];
\r
543 tmp.Height = height;
\r
545 System.Windows.Controls.Canvas.SetLeft(tmp, left);
\r
546 System.Windows.Controls.Canvas.SetTop(d.rectPool[d.rectPoolN], top);
\r
547 tmp.Visibility = Visibility.Visible;
\r
553 partial class Polygon
\r
555 public Polygon dup()
\r
557 return (Polygon)MemberwiseClone();
\r
559 public Polygon clone()
\r
561 return (Polygon)MemberwiseClone();
\r
563 public static implicit operator System.Windows.Shapes.Polygon(Polygon d)
\r
565 var tmp = new System.Windows.Shapes.Polygon { Fill = d.fill };
\r
566 d.stroke.apply(tmp);
\r
567 foreach (Point p in d.vertices)
\r
571 System.Windows.Controls.Canvas.SetLeft(tmp, d.datum.x);
\r
572 System.Windows.Controls.Canvas.SetTop(tmp, d.datum.y);
\r
575 public UIElement toNative() { return this; }
\r
577 public void copyToStack(Templates.StackableDrawable d)
\r
579 var tmp = d.polygonStack[d.polygonStackN];
\r
581 tmp.vertices.Clear();
\r
582 foreach (var v in vertices)
\r
584 tmp.vertices.Add(v);
\r
587 d.stack[d.stackN] = tmp;
\r
591 public UIElement poolNative(Canvas d)
\r
593 var tmp = d.polygonPool[d.polygonPoolN];
\r
595 tmp.Points.Clear();
\r
596 foreach (var v in vertices)
\r
600 System.Windows.Controls.Canvas.SetLeft(tmp, datum.x);
\r
601 System.Windows.Controls.Canvas.SetTop(d.rectPool[d.rectPoolN], datum.y);
\r
602 tmp.Visibility = Visibility.Visible;
\r
609 partial class Letters
\r
611 #region static initializer
\r
612 internal static System.Collections.Generic.Dictionary<int, System.Windows.FontWeight> FONT_WEIGHT_BRIDGE;
\r
613 internal static System.Collections.Generic.Dictionary<Font.Style, System.Windows.FontStyle> FONT_STYLE_BRIDGE;
\r
614 internal static System.Collections.Generic.Dictionary<Letters.HorizontalAlign, TextAlignment> LETTERS_H_ALIGN_BRIDGE;
\r
617 FONT_WEIGHT_BRIDGE = new System.Collections.Generic.Dictionary<int, System.Windows.FontWeight>();
\r
618 FONT_WEIGHT_BRIDGE.Add((int)Font.Weight.normal, System.Windows.FontWeights.Normal);
\r
619 FONT_WEIGHT_BRIDGE.Add((int)Font.Weight.bold, System.Windows.FontWeights.Bold);
\r
620 FONT_STYLE_BRIDGE = new System.Collections.Generic.Dictionary<Font.Style, System.Windows.FontStyle>();
\r
621 FONT_STYLE_BRIDGE.Add(Font.Style.normal, System.Windows.FontStyles.Normal);
\r
622 FONT_STYLE_BRIDGE.Add(Font.Style.italic, System.Windows.FontStyles.Italic);
\r
623 FONT_STYLE_BRIDGE.Add(Font.Style.oblique, System.Windows.FontStyles.Italic);
\r
624 LETTERS_H_ALIGN_BRIDGE = new System.Collections.Generic.Dictionary<Letters.HorizontalAlign, TextAlignment>();
\r
625 LETTERS_H_ALIGN_BRIDGE.Add(Letters.HorizontalAlign.left, TextAlignment.Left);
\r
626 LETTERS_H_ALIGN_BRIDGE.Add(Letters.HorizontalAlign.center, TextAlignment.Center);
\r
627 LETTERS_H_ALIGN_BRIDGE.Add(Letters.HorizontalAlign.right, TextAlignment.Right);
\r
628 LETTERS_H_ALIGN_BRIDGE.Add(Letters.HorizontalAlign.not_specified, TextAlignment.Left);
\r
631 public Letters dup()
\r
633 return (Letters)MemberwiseClone();
\r
635 public Letters clone()
\r
637 return (Letters)MemberwiseClone();
\r
639 public static implicit operator System.Windows.Controls.TextBlock(Letters d)
\r
641 //var zapi_shape = new System.Windows.Documents.Glyphs();
\r
642 var tmp = new System.Windows.Controls.TextBlock {
\r
643 Text = d.str, Width = 500, Height = 500,
\r
644 FontSize = d.font.size,
\r
645 //tmp.FontFamily = ,
\r
646 FontStyle = FONT_STYLE_BRIDGE[d.font.style],
\r
647 FontWeight = FONT_WEIGHT_BRIDGE[d.font.weight],
\r
648 TextAlignment = LETTERS_H_ALIGN_BRIDGE[d.align],
\r
649 Foreground = d.fill
\r
654 case Letters.HorizontalAlign.left: break;
\r
655 case Letters.HorizontalAlign.center: left = tmp.Width / 2; break;
\r
656 case Letters.HorizontalAlign.right: left = tmp.Width; break;
\r
658 System.Windows.Controls.Canvas.SetLeft(tmp, d.datum.x - left);
\r
659 System.Windows.Controls.Canvas.SetTop(tmp, d.datum.y - d.font.size);
\r
662 public UIElement toNative() { return this; }
\r
664 public void copyToStack(Templates.StackableDrawable d)
\r
666 var tmp = d.lettersStack[d.lettersStackN];
\r
670 d.stack[d.stackN] = tmp;
\r
674 public UIElement poolNative(Canvas d)
\r
676 var tmp = d.lettersPool[d.lettersPoolN];
\r
680 tmp.FontSize = font.size;
\r
681 //tmp.FontFamily = ,
\r
682 tmp.FontStyle = FONT_STYLE_BRIDGE[font.style];
\r
683 tmp.FontWeight = FONT_WEIGHT_BRIDGE[font.weight];
\r
684 tmp.TextAlignment = LETTERS_H_ALIGN_BRIDGE[align];
\r
685 tmp.Foreground = fill;
\r
686 System.Windows.Controls.Canvas.SetLeft(tmp, datum.x);
\r
687 System.Windows.Controls.Canvas.SetTop(d.rectPool[d.rectPoolN], datum.y);
\r
688 tmp.Visibility = Visibility.Visible;
\r
694 partial class Image
\r
696 internal void initialize__(int wid, int hei)
\r
698 Canvas.default_api_canvas.Dispatcher.BeginInvoke(new Canvas.TwoIntProcedure(create__), wid, hei);
\r
699 //buffer = new WriteableBitmap(wid, hei);
\r
701 internal void create__(int wid, int hei)
\r
703 buffer = new WriteableBitmap(wid, hei);
\r
706 delegate void FieldFunc1(System.Func<int, int, System.Windows.Media.Color> func);
\r
707 delegate void FieldFunc2(System.Func<int, int, System.Windows.Media.Color, System.Windows.Media.Color> func);
\r
708 public void field__(System.Func<int, int, System.Windows.Media.Color> func)
\r
710 Canvas.default_api_canvas.Dispatcher.BeginInvoke(new FieldFunc1(field___), func);
\r
711 //buffer.ForEach(func);
\r
713 public void field__(System.Func<int, int, System.Windows.Media.Color, System.Windows.Media.Color> func)
\r
715 Canvas.default_api_canvas.Dispatcher.BeginInvoke(new FieldFunc2(field___), func);
\r
716 //buffer.ForEach(func);
\r
718 public void field___(System.Func<int, int, System.Windows.Media.Color> func)
\r
720 buffer.ForEach(func);
\r
722 public void field___(System.Func<int, int, System.Windows.Media.Color, System.Windows.Media.Color> func)
\r
724 buffer.ForEach(func);
\r
727 public Image clone()
\r
729 return (Image)MemberwiseClone();
\r
731 public static implicit operator System.Windows.Controls.Image(Image d)
\r
733 var tmp = new System.Windows.Controls.Image();
\r
734 tmp.Source = d.buffer;
\r
735 System.Windows.Controls.Canvas.SetLeft(tmp, d.datum.x);
\r
736 System.Windows.Controls.Canvas.SetTop(tmp, d.datum.y);
\r
739 public UIElement toNative() { return this; }
\r
741 public void copyToStack(Templates.StackableDrawable d)
\r
743 var tmp = d.imageStack[d.imageStackN];
\r
745 tmp.buffer = buffer;
\r
746 tmp.self_rect = self_rect;
\r
747 d.stack[d.stackN] = tmp;
\r
751 public UIElement poolNative(Canvas d)
\r
753 var tmp = d.imagePool[d.imagePoolN];
\r
754 tmp.Source = buffer;
\r
755 System.Windows.Controls.Canvas.SetLeft(tmp, datum.x);
\r
756 System.Windows.Controls.Canvas.SetTop(d.rectPool[d.rectPoolN], datum.y);
\r
757 tmp.Visibility = Visibility.Visible;
\r
759 throw new Exception("Image.poolNative");
\r