public DrawPanel() { InitializeComponent(); SetStyle(ControlStyles.SupportsTransparentBackColor |ControlStyles.Opaque | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); canvas = null; this.Paint += DrawPanel_Paint; }
public void Draw(Canvas canvas) { foreach (IUpdateable up in updateables) { up.Update(); } canvas.SetClearColor(BackgroundColor); canvas.Clear(); foreach (IDrawable drawable in drawables) { drawable.Draw(canvas); } canvas.Present(); }
public override void Draw(Canvas canvas) { destRect.left = X; destRect.top = Y; destRect.right = X + ClipWidth; destRect.bottom = Y + ClipHeight; if (texture != null) { if (animated) { srcRect.right = srcRect.left + (int)frameWidth; srcRect.bottom = srcRect.top + (int)frameHeight; canvas.DrawTexturePart(texture, destRect, srcRect, Rotation); } else canvas.DrawTextureFull(texture, destRect, Rotation); if (fComponent.InFocus) { canvas.DrawRect(destRect, Color.Red); } } else { if (fComponent.InFocus) currentColor = Color.Red; else currentColor = Color.Green; canvas.DrawRect(destRect, currentColor); } }
public abstract void Draw(Canvas canvas);
private void Init() { CursorHandler.SetMainForm(this); GameApp.Init(); TextRenderer.Init(); objectsTree.Nodes.Add(GameApp.GetTreeNode()); GameApp.OnTreeNodeAdd(); pbDraw.Init(); canvas = pbDraw.GetCanvas(); canvas.SetClearColor(Color.Black); PropPanelLoader.SetMainPropPanel(propPanel); TextureFactory.SetDevicePtr(canvas.GetDevice()); GameApp.ShowPropsPanel(); ToolManager.SetCurrentTool(new InteractionTool()); fpsCounter = new System.Diagnostics.Stopwatch(); }
public void Init() { canvas = new Canvas(Handle, (uint)Height, (uint)Width); }
public override void Draw(Canvas canvas) { if (needReDraw) { if (string.IsNullOrEmpty(text) || string.IsNullOrEmpty(opt.fontName)) texture = null; else texture = TextRenderer.RenderText(opt, text); needReDraw = false; } destRect.left = X; destRect.top = Y; destRect.right = X + ClipWidth; destRect.bottom = Y + ClipHeight; if (texture != null) { canvas.DrawTextureFull(texture, destRect, 0); if (fComponent.InFocus) { canvas.DrawRect(destRect, Color.Red); } } else { if (fComponent.InFocus) currentColor = Color.Red; else currentColor = Color.Green; canvas.DrawRect(destRect, currentColor); } }
public GraphicElements(Canvas workSpace) { WorkSpace = workSpace; }