Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example of using drawing interface #42

Open
kapilth opened this issue Jul 21, 2020 · 1 comment
Open

example of using drawing interface #42

kapilth opened this issue Jul 21, 2020 · 1 comment

Comments

@kapilth
Copy link

kapilth commented Jul 21, 2020

Are there examples on how to use the drawing interface?

@southpolenator
Copy link
Owner

In interactive mode you can write something like this:

// Import IGraphics extensions and Color struct
using SharpDebug.Drawing.Interfaces;

// Create canvas
var canvas = Graphics.CreateCanvas();

// Create some objects
var circle = Grapchics.CreateCircle(Color.Cyan, 100, 100, 10);
var line = Grapchics.CreateLine(Color.Gray, 10, 10, 200, 200);

// Add objects to canvas
canvas.AddDrawing(circle);
canvas.AddDrawing(line);

// Show canvas on screen
canvas.Dump();

You can find more about drawing function by looking at IGraphics interface and by looking at IGraphics extension methods.

Basic idea of drawing interfaces is that you want to visualize some existing data using primitive objects and don't care if you are in UI thread, remote debugging, etc. If you are executing some computer vision algorithm and you want to debug it, you can visualize image and draw results on top of it at every breakpoint. You can also use scripts not to type it over and over again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants