Click here to Skip to main content
15,891,136 members
Everything / Drawing

Drawing

drawing

Great Reads

by honey the codewitch
Explore techniques for drawing using GFX
by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
by Garvit Arya
It is a JavaScript based application for drawing basic free-hand shapes, logos and drawings.
by Swagat Parida
Steps to create a simple drawing app using HTML5 Canvas

Latest Articles

by Minh Danh Nguyen (ToughDev)
This is a cheap 320×240 2.8″ TFT LCD module that uses the ILI9320 controller for the display and the XPT2046.
by honey the codewitch
Use GFX effectively with e-paper/e-ink displays
by honey the codewitch
Explore techniques for drawing using GFX
by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32

All Articles

Sort by Updated

Drawing 

17 May 2015 by A.Ebrahimi
In my project I need to reproduce a property and connection diagram and it is suitable to be something exactly like diagram in MSSQL.I can produce table like object (as in mssql) using panel and grieds dynamically, but main problem for me is how to connect one selected cell to another cell in...
20 Jan 2013 by Abed AlSayed
Hi, I want to make a Paint like App(pencil, text, eraser, lines & shapes drawings) with ability to resize shapes & edit Text at any time (Like Microsoft PowerPoint) in WPF.My Question is : What Tools should I use? (for some reasons I don't want to use Inkcanvas)And how to make my own...
18 Mar 2013 by Abhinav_Sharma
Hi friends,Is there a way to draw tables dynamically(just like MS word 2007)in WPF using drawing visual class.For Eg. IN MS word User Select the no. of Rows and columns using Table Tab and as a result tables get created. Can the Same be implemented in wpfOr How to create tables...
27 Mar 2013 by Abhinav_Sharma
I am currently working on a custom canvas and in that i have to add a table,So i thought dataGrid would be fine. SO i Want to create a "Table" from "Datagrid" by which user can add a table to the canvas at runtime.Till now, I have tried to Populate DataGrid With a list and succeded.How...
15 Sep 2012 by Adam David Hill
Just a quick off-the-cuff idea, but have you tried just wrapping a TextBlock inside a ViewBox? I don't have access to VS at the moment to try, but I imagine that would scale it automatically for you with essentially no special code.Apologies if I've missed something.
30 Oct 2014 by AeroClassics
Make you map using Adobe Illustrator or Photoshop. Then import the file into Blend. When it is imported you will see all the Path Objects with data. Copy these into you XAML file and use them.I do this when adding glyphs to my buttons.Doug
19 Oct 2014 by Afzaal Ahmad Zeeshan
A simple answer is that every stream and resource using code exposes this method .Close() by using which, you can easily close the resource so that a next process can easily use it. Without having to throw an exception to you.I have already posted an answer a few days ago, which had...
3 Dec 2016 by Alper_Baysal
I am using the SimplePerfChart in my program. I am reading data from PLC and draw a line in a chart according to my data. But now i have to draw to seperate line on a single chart area (for example minimum and maximum values ) but i can't do it.Sorry for my english. It isn't my native...
3 Dec 2016 by Alper_Baysal
You are right i am talking about that project. I did that at the same time i posted this question.
11 Dec 2017 by alywaly
I would use the graphics DrawArc method and call this from overridden OnPaint(PaintEventArgs e) private void MyDrawArc(PaintEventArgs e) { // Create pen.d Pen pen = new Pen(Color.Black, 22); // coordinates int x = 100; int y =...
24 Nov 2012 by anssary2010
How to show your System.Drawing.Color palette
17 Aug 2011 by Anthony Mushrow
This[^] NeHe article (among other things) shows you how to render to a texture. The basic procedure is to set the viewport to the size of the texture then render whatever you need, and finally to copy your screen buffer to the texture using glCopyTexImage2D.If you need to update the texture...
10 Mar 2013 by Asim Mahmood
http://stackoverflow.com/questions/8475232/draw-and-fill-a-simple-rectangle-in-c-sharp[^][]http://stackoverflow.com/questions/15295193/how-can-i-draw-a-rectangle-on-webpage-using-asp-net-with-c-sharp[^][]http://msdn.microsoft.com/en-us/library/system.drawing.rectangle.aspx[^][]
3 Oct 2012 by austinbox
Hello,Your question seems a bit vague but interesting, I would recommend using a treeview becuase it supports nodes and images like you said. //First lets read the xml.. List parents = new List(); List nodes = new...
19 Sep 2020 by Avtem
So i'm trying to create a digit clock using only WinAPI with C++ (see the screenshot)[^] Function drawDash() is called 7 times to draw one digit. i use Timer which redraws the digits every 100 milliseconds. Everything looks fine, but for...
23 Sep 2012 by BeStelios
Hi,I have an ItemsPanel extended with my IscrollInfoLogic, ContainerGenerator etc.. (Virtualizing)The ItemsPanel contains FrameworkElements which have a Property type of Drawing.If the Item is visible i do:On the Onrender if the DrawingProperty is not null i go with...
12 Sep 2013 by Bilaal John S
Please checkhttp://social.msdn.microsoft.com/Forums/windowsapps/en-US/141afaf4-9638-4387-9f4e-8bfef1da62f7/how-to-use-svg-images-in-windows-8-store-apps-cxamlhttp://stackoverflow.com/questions/13788934/using-a-svg-file-for-a-background-for-a-windows-store-app-metrothanks,Bilaal
12 Sep 2013 by Bilaal John S
This link will help youhttp://stackoverflow.com/questions/4978723/grid-table-in-wpfThanks,Bilaal
4 Jun 2012 by BillW33
Read this[^] for the basics on drawing with WPF. Also read this[^] article.
3 Sep 2017 by BillWoodruff
using System.Drawing; using System.Windows.Forms; namespace PathStuff { public static class PathExtensions { public static void MakeHole(this Control cntrl, Rectangle xrect) { var region = new Region(cntrl.ClientRectangle); region.Exclude(xrect);...
18 Feb 2014 by bling
This *usually* means the containing window is processing the WM_ERASEBKGND windows message. If the Active-X control draws it's own background - having the containing window do this is a waste and also causes flicker. Override this message to return a non-zero value (eg. 1) to suppress this...
15 Oct 2016 by BurkusCat
Hi there,I am using the Google Location Services API on Android to periodically save a latitude/longitude they were at. I am trying to create a polygon around these points to create a route of where they have been. I want the route to take into the location accuracy for each of the points, so...
11 Dec 2015 by CHill60
Have a look at this CP article Professional C# - Graphics with GDI+[^]There is also a reference zone[^] here on CPOr there always the M$ documentation[^]
7 Feb 2022 by CHill60
There are some articles here on CP that can guide you into building your own Custom Control WinForms Custom Container Control[^] Writing Your Custom Control: Step by Step[^] There is also this article...
21 Jul 2011 by Chris H.F. Tsang
Drawing Polylines by tessellation with joints, caps, feathering and per- vertex color
12 Apr 2012 by Chris Ross 2
It's hard to give advice without knowing your actual level of experience. You say you're a newbie, however, so I'll assume that there's more you don't know (but need to) than what you do know.I would start by researching the simple mechanics of printing from a .Net app. Forget about bar...
17 Jun 2013 by Chris Ross 2
To draw items like rectangles, circles, etc. you need to first think about how you want your user to interact with the program when the are adding a rectangle, etc. For example - mouse down, drag, up might record one corner (mouse down position) and then the opposite corner (mouse up). A circle...
20 Jan 2013 by Christian Graus
This is actually harder in WPF, because the logical way to do it, is not to draw on a bitmap, but to keep track of actions and draw them on TOP of your image. At least, that's how I did it when I did it and it was a royal pain
7 Oct 2012 by Clifford Nelson
This is not straignt forward. I am not sure what you really want, but if you want to page from one to the other I would suggest using a scroll bar with a pane and replacing the image in the window with the correct page. If you are willing to just scroll, I would put the pages into a grid, and...
17 Jan 2016 by cmbay
I am creating a WPF Custom Control Template and I would like one of the GeometryDrawing Brushs to use the Background Brush of the control's container. For example if I put this control on a Window I would like this particular Brush to use the Window's Background Brush. Like wise if the control...
6 Jan 2012 by CoolC22
I am currently writing on a program in Vb.net where I need certain regions or certain pixels of an image to be set transparent. I am not looking for setting a similar color in an image transparent, but specific pixels or regions in the image to be set transparent.Here's the code I tryed, but...
18 Jul 2013 by CPallini
Usually you don't call explicitely it. See "WM_DRAWITEM message" at MSDN[^].
19 Dec 2013 by CPallini
You may also draw it yourself using the relatively simple isometric projection[^].
27 Mar 2014 by CPallini
Yes, you have to implement a method like that, namely GetCity(xmouse, ymouse). It is a pretty straightforward task: you have to find the city most close to {xmouse, ymouse} and pick it (if it is enough close to). 'Close to' is measured by the distance (or the simpler squared-distance:...
14 Dec 2016 by CPallini
"It didn't worked" is not pretty informative. Please elaborate.Anyway, I suppose you are missing a conversion from Screen to Client coordinates (or the opposite). Have a loook at Mouse Events in Windows Forms[^] and at Control.PointToClient Method (Point) (System.Windows.Forms)[^] (for sample...
4 May 2018 by creizlein
I have a custom control that used a lot of Label controls inside, and i started experiencing performance issues when drawing/redrawing the screen So i decided to remove them as they look overwhelming and just draw the texts I needed I started using Graphics.DrawString method, which was SUPER...
22 Apr 2014 by czmn
Hello, i'm new on this site and i try to learn C#.I have a question about the four color problem. I need to do an aplication that simulate the four color maps in win forms. I know how to do in console application using backtracking, but i tried to do in win form using the same algorithm but i...
31 Aug 2015 by DanBecause
I can't say I entirely understand what you mean by "really change the pathpoints", but the Transform property on the Geometry will scale the Geometry before it is rendered and the Geometry will be rendered as though it were the scaled size (not a zoomed version of the original size). So, for...
25 Jul 2015 by Dave Kreskowiak
Technically, infinite.Or, you one with a opacity set to an appropriate value.
7 Dec 2016 by Dave Kreskowiak
It would seem kind of obvious to just check to make sure the height is greater than 0 before drawing the rectangle.
13 Sep 2011 by david94x
Hello everyone.I'm programming a tool that given a section (eg 16 x 16), drawings of characters from an image, but I can not, because everything that I found on the Internet, draw the form. Can anyone help me?This is the code that I did, but that does not work.Thanks in advance:) ...
17 Feb 2014 by DFaeuster
Hey Folks,I'm facing an annoying problem that drives me nuts.On my CView-derived view I placed an ActiveX Control that consists of some buttons - nothing fancy or special. At the beginning it is shown correctly but after the OnUpdate()-method of the view the Control is not shown anymore...
22 Mar 2013 by Dheeraj Singh Bhadoria
This Artical shows that how we can change the color of any image throw Bitmap
19 Dec 2013 by Domus1919
Hi, I'm using OpenCV on Visual C++ 2010 for elaborate a set of images. But now I need to draw a set of 3d points (x,y,z) in a 3d space, because I need to have a feedback of how these points are allocated in 3d space. I don't need to do anything exceptional, so what would you advise me...
6 Jun 2014 by DrGrim
i found out how to do this right this is the url from which i got the codehttp://www.daniweb.com/software-development/vbnet/threads/151127/correctly-displaying-image-in-picturebox[^]NOTE !! This will scale the image to "fit" the picturebox so if you decide to save the image it will...
25 Jun 2014 by DrGrim
hello once again !could someone tell me how could i save an image that i drew (painted) on it with the same image quality as the original image ?i'm using this code to save the image :Using Bmp As New Bitmap(PictureBox4.Image, defaultWidth, defaultHeight) Using G As...
25 Jun 2014 by DrGrim
Thank you OriginalGriff , i have tried your way and with no result from what i have read on google this blur appears due to the bitmap resize .
5 Jun 2014 by DrGrim
hello ! so i got this project , to make a paint like application . The Application must load and image and one must be able to draw on that image .This loads the image and preps it for editing : Quote:PictureBox4.Image = Image.FromFile(str) PictureBox4.SizeMode =...
10 May 2016 by farhad baghyari
Hi i am a mechanical engineering student.(so i don't know too much about programming)I wanna make a program that draws curves with rational Bezier (I should write the code myself and not using formGraphics.DrawBezier). I've recently started learning c# and i am so new to it. I've searched alot...
13 Jun 2012 by Farhan Ghumra
I am developing a whiteboard application in WPF.How can I draw a rectangle and circle/ellipse by dragging the mouse like we do in Paint by dragging the mouse pointer ?I am using WPF canvas for drawing.P.S. : I have refered this article, but it's too complex, i am not able to understand.
25 Jun 2012 by Farhan Ghumra
Hello,I m developing paint like application for windows 8. I have tried but I can't even developed even a line drawing tool. My application will have free hand tool, line, rectangle, ellipse, circle drawing tool, erasor. I am using canvas tool for drawing.So please guide me with some...
27 Jun 2012 by Farhan Ghumra
Hi, I am developing a paint like application in metro style. I want to apply a eraser functionality. So how can I make such a tool for erasing the content from canvas like we do in MS paint ?I don't want to clear whole canvas, wherever I click or drag the pointer, the path traveled by the...
28 Jun 2012 by Farhan Ghumra
I need sample application explaining use of WriteableBitmapEx for winrt or wpfI have checked the codeplex but I am not getting any output in my metro application.
6 Nov 2013 by Farhan Ghumra
A Metro style app for basic drawing feature.
8 Jul 2012 by Farhan Ghumra
Hi, I am developing a note taking application in C#/XAML. I want a user to write anything on canvas with InkManager of "Windows.UI.Input.Inking". Then I want to display it as text onto canvas and then I want to save those recognized text in either text or image format.I have checked MSDN[^]...
10 Jul 2012 by Farhan Ghumra
Here is my solution IReadOnlyList text; string finalt = ""; private async void Recognize_Click(object sender, RoutedEventArgs e) { IReadOnlyList x = await _inkManager.RecognizeAsync(InkRecognitionTarget.All); ...
22 Jul 2012 by Farhan Ghumra
i have successfully developed my app, you can check Metro Paint[^]
4 Jan 2015 by Farhan Qureshi
Hi,I am using blow code to insert textbox in ms-word document. It inserts all the textboxes in one page i want to start a new page when end of page occurs. using Microsoft.Office.Interop.Word;using System.Data;using Microsoft.Office.Core;float top = 20;float height =...
5 Feb 2013 by fjdiewornncalwe
The syntax error you are receiving is because of the semi-colon at the end of your function declaration which causes the spriteBatch variable on the next line to be out of scope.public void Draw(SpriteBatch spriteBatch);
29 Mar 2012 by Frank R. Haugen
I have a half-finished tool for calculating distances between real-life stars, and positions in space, and much more, but I'd like to make a 2D map of the 100'000 closest stars, but I need some advise.Firstly; making the position X=0 and Y=0 location dead center of the program window, (with...
25 Aug 2014 by Fredrik Bornander
Use a scale Transform;Matrix matrix = new Matrix();matrixsetScale(2.0f, 2.0f);// path is your pathpath.transform(matrix); Or, if you want to scale around the center of the path;Matrix matrix = new Matrix();RectF boundingBox = new RectF();path.computeBounds(boundingBox,...
21 Feb 2015 by FrostedSyntax
A method to get the inverted equivalent of a specified color.
3 Jul 2012 by Fun@learn
Check the sample application present with the library. They are very helpful to understand how to use, tweak the library.This library is excellent. Bitmap operations are not supported natively, but these guys did all the hard work to make it simpler for others.Major reason for this...
15 Jun 2014 by Garvit Arya
It is a JavaScript based application for drawing basic free-hand shapes, logos and drawings.
22 Dec 2014 by Gerald Degeneve
Draw or render a Windows Form directly over the Wallpaper, behind the Desktop Icons in Windows 8+10
30 Aug 2018 by Gerry Schmitz
Blinking or "strobing" can cause epileptic fits in certain individuals and is therefore not recommended. It's grouped in with "web sites that suck". ("Rotating" is better IMO).
8 Sep 2020 by Gerry Schmitz
.net - C# Create Gradient Image - Stack Overflow[^] This is a mod of the above (changed one of gradient colors and the file type). The point is you can save a transparent gradient; you just have to think more about how you apply your other...
14 Apr 2015 by Gokulprasad05
Triangle FarPlaneDistance="100" LookDirection="-12,-11,-10" UpDirection="0,1,0" NearPlaneDistance="1" Position="11,10,9" FieldOfView="75" /> ...
23 Nov 2014 by golden_cjs
who can give me some advice about how to get the point of TreeView Node.I want to draw a picture with two TreeView Control and I Must to Draw a line from the First TreeView Node to another TreeView Node.who can give me some advice.please
5 Nov 2012 by govindaAlwani
I am bit confused how to calculate dx and dy in sobel edge detection method ....I googled it and i found that.......public class SobelEdgeDetector : ImageFilter { private Color grayscale(Color cr) { return Color.FromArgb(cr.A,...
31 Aug 2017 by Graeme_Grant
[moved from comments - thanks for the suggestion RickZeeland] Is the hole suppose to show objects behind it? Like a transparent hole? Something like this: Making Transparent Controls - No Flickering[^][^]???
15 Dec 2011 by Harish Kumar Bansal
Hi,I am developing a program. In this, i have a form with some controls like Button and Labels on the form. Now i draw a line on the form using DrawLine() method but this line appears in the backgrounds of all the controls like labels and Buttons. I want to draw line, above all the...
6 Jan 2012 by hassan faghihi
use Graphic class in draw/ing namespacethen pass your form/panel.... instance to itGraphic g= Form1.CreateGraphic(); //(or some thing like this..)then u can call g and put dot ('.') after it and all function of drawing will appear .you can crate pen from brushes and bruses from color...
25 Apr 2021 by honey the codewitch
Explore the basic drawing functionality provided by the GFX IoT library
4 May 2021 by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
6 May 2021 by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32
3 Jun 2021 by honey the codewitch
Explore techniques for drawing using GFX
18 Jun 2021 by honey the codewitch
Use GFX effectively with e-paper/e-ink displays
3 Sep 2014 by HuggableAlien
Hello,I am trying to make a program similar to Moraware's CounterGo, and one of the best features in it is the way you can draw a polygon by simply dragging the mouse around a canvas.Is there a way to recreate this in Javascript? I have tried SVG-Edit, but there are too many tools, and I...
11 Dec 2012 by imran.mm7
Dear all, I have a very large xml file. In this file i have various data. I am using linQ to collect the particular information. I would like to present this information in a graph form (not the tree view control). This graph would simple contains data (parents) as circles or rectables and...
12 Dec 2012 by imran.mm7
Thank you for the link, but as i asked in my question. I need to draw it in a tree shape ...not chart..i already used Microsoft chart control to render data in charts..but now my interest is to render data in graph form..hopefully that clarifies my question..greetings
15 Jul 2015 by Inimicos
Here is my code.using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using...
6 Mar 2016 by Jakub Szymanowski
The article presents idea and implementation of Fourier Transform (DFT and FFT algorithms) in Digital Signal Processing.
24 Jun 2011 by jiji2663
i have a paint control for drawing.i want cut of a picture were drawed in paint controlx1=>first of draw in paint controlx2=>end of draw in paint control Rectangle rec = new Rectangle(paint_Control1.X1, 0,paint_Control1.X2 - paint_Control1.X1, paint_Control1.Height); ...
17 Aug 2011 by joe628aa
Hi There!I'm trying to draw non rectangular 2D shapes (polygons, ellipses) with open gl es in .net cf, which are textured with gradients. I thought that i could create the gradient by drawing a rectangle with its vertices colored and than use that rectangle as a texture on the actual shapes....
18 Aug 2011 by joe628aa
Thank you for the answer, I'll try it out.
4 Jun 2012 by JoeBlowski
I want to represent the layout of components on a circuit board by drawing multiple rectangles on a WPF canvas (if canvas is the best container). Sizes and geometries of components are maintained in a class already developed. Can anyone suggest an approach to drawing shapes in the code behind,...
28 Mar 2013 by johannesnestler
assuming your code is working - just change the scG.FillRectangles to (a looped) call to scg.DrawImage ...
20 Apr 2021 by JR212
Hi, How Can I see if 2 or more circels intersect or touching each other? What I have tried: When using rectangle and the upper left corner touch the lower right corner the circles aren't really touching. but intersect return true
1 Aug 2018 by KarstenK
If the control is completly owner drawn that you should use FillRect with your bckground color at first draw call. And I would suggest that you store the Windows-handle of the control and other constant objects (like the pen) as member variables to improve performance.
3 Aug 2018 by KarstenK
Another solution is to use PostMessage for a WM_PAINT message which triggers the painting of your control. Best is to use InvalidateRect for the control before. Tip: Create the pens only once, as class members or as static objects to improve performance.
21 Oct 2019 by KarstenK
Than you need to acquire the knowledge. I used my search engine to find the dxf format in the wikipedia. Read it to understand the format and follow some links. When you understand it, you may write some converter code. It is simple text readable format, so simple things shouldnt be too hard. ...
19 Sep 2020 by KarstenK
Your problem is here:FillRgn(hdc, hrgnClip, CreateSolidBrush(color)); in creating a brush and NOT deleting it. Asign it to a var use it and than delete it later, or if the color is constant you need to create it only once. Your error case is...
28 Mar 2013 by kastriotlimani
Hi, i am a beginner at coding, and i am making a little game where a character is capturing some dots generated randomly.Now i need each dot to be an image (same image for all), but i cant find out how to do it.This is a piece of what I did:Rectangle[] rects;rects = new...
8 Apr 2013 by kastriotlimani
I am looking forward to make a rosette using c# graphics...Here is what I'm trying to achieve:https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Academ_rosette.svg/630px-Academ_rosette.svg.png[^], of course not the lines outside the circle.If someone can give me some lines of code...
10 Mar 2013 by kaushal joshi
Can any one tell me full code of draw a rectangle in webpage using asp.net c#. But i don't want to use bitmap image here. I need a simple webpage using c# asp.net in which only one rectangle should be there but without using bitmap image. Please do not use this:Bitmap bmp = new Bitmap(width,...
30 Jun 2014 by Keith O. Williams
I am making a Bejeweled game in Visual Basic Professional 2010 (which is apart of the web browser known as Scoontz) and I stumbled across an error when trying to draw a sprite: DrawSprite is not a member of Scoontz.SpriteHere is the code (with the line in question in bold): ' Note...
15 Sep 2012 by Kenneth Haugland
Can you use this:TextBox myText = new TextBox();Rect textRext = myText.GetRectFromCharacterIndex(myText.Text.Length);http://blogs.microsoft.co.il/blogs/tamir/archive/2007/03/12/Text-length-measurement_3F00_-It_2700_s-really-easy-with-WPF.aspx[^]
28 Oct 2014 by Kinna-10626331
Hi ,as a test I am adding as background of a Grid column a DrawingBrush element which using PElipseGeometry draws something similar a strech ellipse.Here is the code: ...
27 Feb 2014 by KUMAR619
I created a polygon by clicking points in the picture box.So the points are user defined at the run time.I want to make an offset polygon over it.How to make polygon offset at all sides.Can anyone give me the codePlease help me to create an offset polygon