How to draw 2 color circle using Graphics? [Answered] #1301
Replies: 5 comments
-
Posted at 2019-12-11 by @allObjects What size will the circle have? 5 times a second fully around seems to me a bit demanding... I would approach it the following way: think about two hands - a black one and a red one - to take the color of your pic that start in the center out to the border your pic implies. Then constantly draw the black one advancing the line into the read zone and the red one advancing into the black zone. The be fast, you may precalc the cordinates for one quadrant and then just look up the values. Since hand are only one pixle, the size and number of step relate to each other... Should you run out of time - to much to do - do less steps and draw wide hands: 2 or 3 pixles wide rectangles... If you dounle the number of coordinates, ou can avoid drawinalways from center... becasuse of points will not change color for many steps. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-11 by @allObjects ...what about this... watch attached .mp4 clip. Adjust things to your likings. Notice that below eample was running in emulator when clip was taken. Real behavior can only be seen on real device... Since I jhave only 16 circle segments, I chose to fill closed polys of 3 points: center, seg begin and seg end on circumference.
Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-12 by @allObjects Updated the example and code. Dimensions are now all absolute and not some scaled, and scaling is included in vertices. So different vertices can be provided as needed render nicely larger and more efficient smaller 'circles'/'discs'. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-12 by Abhigkar Thanks @allObjects, I will test it, but it seems you gave me an idea to start my own. :) Thanks a lot!! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-13 by @allObjects @abhinav, to get you going on your own was my intension from the very beginning, because last but not least the requirements in the first poast are very frugal. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-11 by Abhigkar
I want to draw 2 color circle and rotate it slowly roughly 5 times in a seconds (1 degree per step).
What is the best way to achieve with smooth animation (no flickering) ?
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions