Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.3K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 466 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Conversion from VisualC++ to Java(AngleArc to drawArc)

Hi,
I want to convert from VC to JAVA. I have AngleArc in VC ( 5 arguments) & drawArc in Java(6 arguments). Their syntax is given below:
drawArc(int xTopLeft, int yTopLeft, int width, int height, int startAngle, int arcAngle);
BOOL AngleArc( int x, int y, int nRadius, float fStartAngle, float fSweepAngle);
Instead of width & height they are using only radius. Some body please guide me how to do this conversion.
Zulfi.
Best Answer
-
Hi,
I am able to solve this problem through trial & error method. Though i have to change the values but i have kept the angles constant.
Zulfi.
Answers
-
I want to convert from VC to JAVA. I have AngleArc in VC ( 5 arguments) & drawArc in Java(6 arguments). Their syntax is given below: drawArc(int xTopLeft, int yTopLeft, int width, int height, int startAngle, int arcAngle); BOOL AngleArc( int x, int y, int nRadius, float fStartAngle, float fSweepAngle); Instead of width & height they are using only radius. Some body please guide me how to do this conversion.
This is your THIRD thread about basic graphics topics. The forums are NOT a coding service. They are to help you with YOUR code.
You will NOT be successful if you refuse to read the documentation and then follow tutorials to learn how to use Java functionality.
If you review the API documentation for those functions you should be able to EASILY see that the width and height refers to a box that a circle/ellipse fits inside. Which means width and height are the DIAMETER.
Graphics (Java Platform SE 7 )
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183354%28v=vs.85%29.aspx
So if you know the diameter you should be able to compute the radius. And if you know the coordinates of the enclosing rectangle you should be able to determine the coordinates of the center of the enclosed circle.
Then write some sample code and see what the results are.
-
Hi,
Thanks for your guidance.
>So if you know the diameter you should be able to compute the radius. And if you know the coordinates of the enclosing >rectangle you should be able to determine the coordinates of the center of the enclosed circle.
What about the coordinates x & y? They refer to center of circle in VC but in Java it says upper left corner.
Please guide me.
Zulfi.
-
Hi,
In VC i was using the command:
pDC->AngleArc(90,124,10,30,150);
In JAVA I tried:
g.drawLine(0,250,0,160);
g.drawLine(0,160,30,200);
g.drawLine(30,200,80,120);
g.drawArc(90,124,20,20,30,150);
g.drawLine(99,119,150,180);
This is what I am getting:
Some body please guide me.
Zulfi.
-
Please guide me.
I did guide you - to The Java Tutorials trails that SHOW you , with working code, how to draw graphic objects in Java.
And if you know the top, left corner of the square that encloses a circle you should be able to EASILY compute where the center of the circle is.
There are NO SHORTCUTS. You have to be willing to WORK and try things.
Draw that square. Draw a circle. Is the circle totally inside the square? Then move the circle up or down as needed as redraw it.
You learn by DOING. Go through the tutorials and actually DO the examples.
-
Hi,
I am able to solve this problem through trial & error method. Though i have to change the values but i have kept the angles constant.
Zulfi.
-
Hi,
>Draw a circle.
There is a command for oval but no command for circle. Plz guide me how to draw a circle in Java.
Zulfi.
-
I am able to solve this problem through trial & error method. Though i have to change the values but i have kept the angles constant.
Good for you! That wasn't so hard was it?
When you TRY things you get a lot more feedback than you will ever get on the forums because you can SEE the result of what you did.
Then you can change it a little bit and SEE how it is different. That visual feedback is what you MUST HAVE when you work with graphics. Very few people can 'visualize' graphic objects just by looking at a bunch of coordinate values.
Especially with graphics you aren't going to break anything by trying stuff.
You should now be able to create a simple program that draws your object and then AUTOMATICALLY changes each attribute, one at a time in a loop, and shows a 'movie' that shows how the object changes.
-
what is the difference between an oval and a cycle in a mathematical sense?
bye
TPD