Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
1.14/5 (3 votes)
See more:
hi all, how can
Draw a circle with a radius of user?
Posted
Comments
Afzaal Ahmad Zeeshan 23-Dec-14 17:29pm    
The question would be, "How to draw with a variable radius, got from user". Secondly, you've not told which language you're using or which UI framework you're working on. Assembly won't do it at all.
samadblaj 23-Dec-14 17:37pm    
Draw a circle with a radius. no speak english.soure
Afzaal Ahmad Zeeshan 23-Dec-14 17:38pm    
In which language? C#, C++, Java, VB.NET, any of these?
samadblaj 23-Dec-14 17:41pm    
assembly language or emu8086
Afzaal Ahmad Zeeshan 23-Dec-14 17:44pm    
Assembly Language doesn't support UI. You need to work with some high-level language, such as Visual C# or Java etc to perform these tasks for drawing graphics on screen.

This is not an easy task, as I have already mentioned in my comments to your question you should know that drawing these objects on screen is a tough job and you need to understand the concepts of graphics, and how to draw the stuff on screen using the pixels and many more. If you were to use a high-level language, such as Java or Visual C# they would allow you to use their namespaces and classes to work with graphics just like calculating a few values and print it to the screen.

But, since assembly is a low-level language, there is no graphics stuff built right into it that would let you draw a circle and if it did, the radius to be a variable would take another file of code. And you're asking for a machine language code (your last comment) you seem to be confused about what you're doing and which language you're going to use and what is the scenario around. That is why, I am not going to confuse you any further.

There is another question[^], to which is an answer[^] that I would like you to read. If, doesn't include the code to build and draw that circle on the screen. But it might give you an idea to draw the circle using Assembly language, using some different algorithms.

Again, to work with graphics, you should use a high-level language. Working in low-level for drawing purposes is not an efficient way.
 
Share this answer
 
Comments
samadblaj 23-Dec-14 19:03pm    
not assembly developer....
Except for homework, it does not make much sense to write such code in assembler.

Here, I have a few links on how to draw circle but you would have to write assembler code by yourself...

http://stackoverflow.com/questions/9007977/draw-circle-using-pixels-applied-in-an-image-with-for-loop[^]

http://stackoverflow.com/questions/9007977/draw-circle-using-pixels-applied-in-an-image-with-for-loop[^]

http://en.wikipedia.org/wiki/Midpoint_circle_algorithm[^]

Update
If you want assembler code, then look the code generated by the compiler as a starting point.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900