Last question for today - how to draw with API circle of N pixels radius

Hi,
While I'm bit of exhausted while fighting with those paths movement (see my other thread in this forum) - I'd like to ask maybe someone has code snippet, which shows how to draw a circle of N pixels/N mm/inches radius?
There is one helper function for that inside SDK samples:
PDEPath DrawCurve(ASFixed x, ASFixed y, ASFixed x1, ASFixed y1, ASFixed x2, ASFixed y2, ASFixed x3, ASFixed y3, int lineWidth, int r, int g, int b)
but I'm just out of my mind for today what parameters should be provided and how many calls of it I should write.
Any help would be appreciated.

You call it four times...
Here is a snippet that explains the math...
/* 4/3 * (1-cos 45)/sin 45 = 4/3 * sqrt(2) - 1 */
#define ARC_MAGIC ((ASFixed) 0.552284749)
#define PI ((ASFixed)3.141592654)
void DrawCircle( ASFixed inCenterX, ASFixed inCenterY, ASFixed inRadius )
/* draw four Bezier curves to approximate a circle */
MoveTo( inCenterX + inRadius, inCenterY );
CurveTo( inCenterX + inRadius, inCenterY + inRadius*ARC_MAGIC,
inCenterX + inRadius*ARC_MAGIC, inCenterY + inRadius,
inCenterX, inCenterY + inRadius );
CurveTo( inCenterX - inRadius*ARC_MAGIC, inCenterY + inRadius,
inCenterX - inRadius, inCenterY + inRadius*ARC_MAGIC,
inCenterX - inRadius, inCenterY );
CurveTo( inCenterX - inRadius, inCenterY - inRadius*ARC_MAGIC,
inCenterX - inRadius*ARC_MAGIC, inCenterY - inRadius,
inCenterX, inCenterY - inRadius );
CurveTo( inCenterX + inRadius*ARC_MAGIC, inCenterY - inRadius,
inCenterX + inRadius, inCenterY - inRadius*ARC_MAGIC,
inCenterX + inRadius, inCenterY );
Close();

Similar Messages

  • Tiny hand-made extension for Mavericks, how-to/what-with?

    Tiny hand-made extension for Mavericks, how-to/what-with?
    We need one small extension in Mavericks.
    The goal and prerequisites are described below.
    Preferable on script basis.
    The question how the goals can be achieved and by use of which Mavericks on-board tools?
    Extension's UI available in system menu (preferable the context menu while in a Finder window).
    Script conducts on invocation following operations:
    - create a new text file in folder of current Finder window
    - file name can be fixed programmed in script
    - add to the file name appropriate postfix if file already exists
    - inject into file a string which is fixed-coded in the script
    - inject in file's next line the clipboard content
    It is in user's responsibility to ensure the clipboard content is a text
    - save file changes to disk
    - close the file
    - Optionally ask user for file name

    Tiny hand-made extension for Mavericks, how-to/what-with?
    We need one small extension in Mavericks.
    The goal and prerequisites are described below.
    Preferable on script basis.
    The question how the goals can be achieved and by use of which Mavericks on-board tools?
    Extension's UI available in system menu (preferable the context menu while in a Finder window).
    Script conducts on invocation following operations:
    - create a new text file in folder of current Finder window
    - file name can be fixed programmed in script
    - add to the file name appropriate postfix if file already exists
    - inject into file a string which is fixed-coded in the script
    - inject in file's next line the clipboard content
    It is in user's responsibility to ensure the clipboard content is a text
    - save file changes to disk
    - close the file
    - Optionally ask user for file name

  • I forgot my security questions for itunes, how can i find out my answers?

    i forgot my security questions for itunes, how can i find out my answers?

    Alternatives for Help Resetting Security Questions and/or Rescue Mail
         1. If you have a valid rescue email address, then use this procedure:
             Rescue email address and how to reset Apple ID security questions.
         2. Fill out and submit this form. Select the topic, Account Security. You must
             have a Rescue Email to use this option.
         3. This is the only option if you do not already have a valid Rescue Email.
             These are telephone numbers for contacting Apple Support in your country.
             Apple ID- Contacting Apple for help with Apple ID account security. Select
             the appropriate country and call. Ask to speak to the Account Security Team.
         4. Account security issues almost always require you to speak directly to an
             Apple representative to securely establish your identity as the account holder.
             You can set it up so that Apple calls you, either immediately or at a time
             convenient to you.
                1. Go to www.apple.com/support.
                2. Choose Contact Support and click Contact Us.
                3. Choose Other Apple ID Topics and choose the appropriate topic for
                    your issue.
                4. Follow the onscreen instructions.
             Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    Your Apple ID: Manage My Apple ID.
                            Apple ID- All about Apple ID security questions.

  • How to draw a perfect circle and how to make sure it is perfectly centered inside a square

    How to draw a perfect circle and how to make sure it is perfectly centered inside a square in Photoshop elements using the Ellipse option.

    1. Create a square canvas.
    2. With the Elipse tool, hold down Shift (Shift forces a circle). Draw the circle anywhere on the canvas (Shape 1 in this example).
    3. Simplify the circle layer
    4. Ctrl-click the layer to select the circle.
    5. Copy the selection to the clipboard (Edit > Copy).
    6. Deselect the selection.
    7. Paste from the clipboard (Edit > Paste). The pasted circle (Layer 1) will be centered.
    8. Delete the original circle layer.
    NOTE: Step 6 is the key. This guarantees that the pasted circle will be centered.
    If you want a circle completely within a square you can simply draw and simplify a circle on any shape canvas. Ctlrl-click the circle to to select it and copy to the clipboard.
    Then do File > New from Clipboard. This creates the circle cropped to a square on transparent background.

  • How to draw with mouse on Html 5 canvas inside browser (using createJs).

    Hi Everyone,
    In Flash AS2/3 we can draw with mouse in browser (of course inside Flash Player). How can we do that in Flash CC Canvas using CreateJs (result must be in canvas not in flash player). Something like this http://www.codicode.com/art/how_to_draw_on_a_html5_canvas_with_a_mouse.aspx
    Thanks in Advance

    This is a bit more of a JavaScript / Canvas question than a Flash question. I realize you're using the Flash product but Flash CC is just giving you an IDE with limited JavaScript automation.
    In this mode you're expected to be familiar with JavaScript and CreateJS. Are you?
    If not, what you might want to do is look at a sister product for HTML5 Canvas automation called EaselJS. It's a JavaScript library that makes using the Canvas very easy. Have a look at the commands here:
    http://www.createjs.com/Docs/EaselJS/modules/EaselJS.html
    You might find you don't need Flash CC to perform what you want. Otherwise this conversation may tip so deeply into JavaScript and CreateJS that it might be more prudent to use the Dreamweaver forum.

  • Initial setup of corporate phones for Intune - how to deal with initial account required

    Hi,
     I'm running an Intune trial and have a question about new phones for corporate users - I find it irritating that a Microsoft account or an AppleID is needed to download the company portal app. For example the Nokia 935 with Windows 8.1 doesn't allow
    me to sign in to the Windows store using my corporate Office 365 account, if I proceed without a Microsoft account to the store and try to install the company portal app, I get an error message about "My Family setup is needed" first.
     I'm thinking of creating a Ms or Apple account for each user and use that to enrol their devices, but that doesn't seem ideal. Ideally I just want to deploy the Company portal app.
    What's the recommended approach?
    Thanks

    I understand what you mean, but in this case the application installation is not the issue, it's signing up for an Apple ID that's the issue.  Here's an example of questions that come up, keep in mind these are company owned phones:
    It's asking for a credit card, what do I do?  (I know that usually there's an option of none, but sometimes there's not)
    What should I put for address and phone numbers?
    This is a company phone, why is it asking for my best friend in second grade?
    I already have a personal Apple ID, should I use that on my corporate owned phone?
    What's my password?
    What's my username?
    I don't want Apple to have my email address, why are you making me do this?
    I don't have time for this, why is this taking so long (enrolling an iOS device in Intune is very easy and quick, signing up for an Apple ID can be complex and difficult for an older person that can barely use a computer)

  • FTP question for newbie -- How to access external volume?

    I have set up an old Mac (running Tiger) as a server on my LAN; attached to this Mac are several Firewire disks. I want to use FTP (with retrospect Express) to automatically back up from another computer to these disks.
    I can successfuly mount these Firewire disks using AFP on the other computer. But when I use FTP, I seem only to access the user account I use to log in. How do I get FTP to go those Firewire disks to transfer the backup files?
    Please forgive me if this is a naive question... Thanks in advance for any advice!

    To configure the FTP server in Tiger requires creating and editing certain files using the terminal application. So if you have no prior UNIX or command line experience you may find this tricky and you would need to read the man file for ftpd.
    So I would suggest you try out PureFTP manager which is a front end application for an alternative FTP server.
    I have used this Application and found it quite straightforward to use.

  • Time machine questions... how to use with an external drive etc.

    Hi,
    I am about to start using Time Machine. I have a few questions:
    1. Can Time machine be used to restore data and applications / application settings?
    2. I have a CalDigit VR eSATA drive which is 1TB RAID 1 which I was going to use as the Time Machine target drive.
    Does Time machine store all of its data files in one main folder with many sub folders?
    If my TM backup data takes up 600GB on the drive can I safely store other data on the 400GB or is it best to partition the drive HFS+ Journaled 600/400 and leave TM to its own dedicated partition?
    3. Does TM keep adding data until it runs out of disk space and only then delete older BUs?
    4. Is TM a good backup software for total recovery or is something like SuperDuper better? I would almost never use TM to recover a file that was deleted... but I am looking for a way to protect against data lost in the case of HD failure.

    If you haven't found this yet, take a look here: http://www.apple.com/findouthow/mac/#tutorial=leopardtimemachine
    That should give you a rough idea of the "look and feel."
    1. Can Time machine be used to restore data and applications / application settings?
    Yes, unless you tell it not to, it saves everything (except some system caches, temp files, etc.). If your HD fails, you can recover your entire system to a new/repaired HD via your Leopard install disc (it has the restore utility) and your TM backups. OS, apps (Apple and 3rd-party), preferences, settings, data, the whole system.
    Does Time machine store all of its data files in one main folder with many sub folders?
    As you may be able to see in the video, the small Finder window is very much like the main one; you can see your data in the same way. TM presents a "picture" that appears to be a full, separate backup of the way your Mac looked at any time. Of course, that's an illusion. It only actually copies files/folders that have been added or changed since the last backup.
    You can't tell which items are "real" and which are the "multi-links" representing a file that didn't change on that particular backup.
    For more info on the internals: http://www.appleinsider.com/articles/07/10/12/roadto_mac_os_x_leopard_timemachine.html
    3. Does TM keep adding data until it runs out of disk space and only then delete older BUs?
    Sort of. After an initial Full backup, it does incrementals (hourly, if you let it). Then it converts the first of the day to a daily backup, which it keeps for a month, and deletes the other hourlies after they're 24 hours old.
    After a month, it converts one per week into a weekly backup and deletes the dailies.
    It keeps the weeklies until it runs out of room, then begins deleting the oldest. But because of the "multi-links," it doesn't delete it's copy of anything that's still on your internal HD. So it manages it's space and deletions automatically and intelligently.
    4. Is TM a good backup software for total recovery or is something like SuperDuper better?
    They both have their advantages and disadvantages. Many of us use a clone plus TM. The clone advantage is, of course, being bootable. TM isn't. TM's advantages are the very fast incremental backups (it doesn't have to examine every file and folder to see what's changed): the ability to restore old items; and the ability to restore your entire system to a previous state, even if that's a prior version of Leopard!

  • My last question for now!

    Hello there, its me again, I managed to do the next two questions on my own!! :-) I'm on the last one now, I have a solution but I feel like I'm missing the point with my code as I have had to retype similar code 3 or more times and some lines aren't even used...but if I follow the instructions they should be there. See what you think....
    The aim of this question is to develop the code for a queue which holds int
    values. The queue is based on an array and is extensible in that if an item is
    added to the queue and the queue is full and an item is added then further space is created within the queue
    for the new item. There are 6 methods which need to be provided: head() gives
    the int that is the first item in the queue without removing it, tail() gives the int that is the last
    item in the queue, add(int) adds an item to the queue, remove() removes the first item
    from the queue and returns it, queueLength() gives the number of items in the queue and
    display() displays the contents of the queue in order on System.out.
    Two constructors are also required, the first IntQueue() sets up a default
    queue with 30 elements which, when it becomes full and an item added, adds 5 extra locations to the
    end of the queue; the other constructor IntQueue(int,int) sets up a queue
    with a length given by its first argument and will add the number of locations
    given by its second argument when it is full and an item is added.
    The queue should be based on an array with the first element of the array
    holding the head of the queue. When an item is removed from the queue the
    remainder of the array should be copied forward.
    Do not worry about programming errors such as an item being removed from
    an empty queue.
    We also want you to provide a class Tester for you to test your methods.
    public class IntQueue {
    private int[] queue;
    // Remainder of instance variables
    int added =0;
    int added2=0;
    public IntQueue() {
    // Code for default constructor
    queue = new int [30];
    if (added >= queue.length) {
    int[] newArray = new int[queue.length + 5];
    System.arraycopy(queue, 0, newArray, 0, queue.length);
    queue = newArray;
    public IntQueue(int size, int increment){
    // Code for two argument constructor
    queue = new int [size];
    if (added2 >= queue.length) {
    int[] newArray2 = new int [queue.length + increment];
    System.arraycopy(queue, 0, newArray2, 0, queue.length);
    queue = newArray2;
    public int head(){
    // Code for head
    return queue[0];
    public int tail(){
    // Code for tail
    return queue[queue.length];
    public int queueLength(){
    // Code for queuelength
    return queue.length; //String.valueOf(queue.length);
    public void add(int item){
    // Code for add
    if (added >= queue.length) {
    int[] newArray = new int[queue.length + 5];
    System.arraycopy(queue, 0, newArray, 0, queue.length);
    queue = newArray;
    queue[added] = item;
    added++;
    public int remove(){
    // Code for remove
    int removed = 0;
    removed = queue[0];
    int[] newArray3 = new int[queue.length - 1];
    System.arraycopy(queue, 1, newArray3, 0, newArray3.length);
    queue = newArray3;
    return removed;
    public void display(){
    // Code for display
    for (int i = 0;i < queue.length;i++){
    System.out.println("Array queue["+
    String.valueOf(i) + "] = " + String.valueOf(queue));
    }

    int added =0;
    int added2=0;
    One error I see straight off is with your instance variables. You haven't made them instance variables! What you have above is what u do when declaring a local variable not an instance.
    Try making them instance variables! Same way you made an instance of queue!

  • I need to reset my security questions for iTunes how can I do that as soon as possible

    I was trying to but music and they had told me that I needed to answer my security questions and I forget the answers that I put in for them. How can I reset the questions?

    1)  Apple ID: All about Apple ID security questions
    If necessary
    2)  See Here... ask to speak with the Account Security Team...
    Apple ID: Contacting Apple for help with Apple ID account security
    3)  Or Email Here  >  Apple  Support  iTunes Store  Contact

  • Question for N6300/ How to enlarge contact image?

    I just purchased a N6300, going from a 6600, and it bothers me that it does not show a large picture of the person that is calling me, just a small thumbnail. This thumbnail was even bigger on the 6600, and the whole picture could be displayed with apps for S60 (Symbian). Is there a setting of some sort or Java app that can be used to enlarge this caller image when calling or such? 10x

    No. On S40 phones you cannot run java apps in the background as you can do on S60.
    Knowledge should be your Advisor when you need help.
    1610»2110»8110»5110»3310»6210»7250i»6220»6230»6230i»6233
    Love me or hate me, its still an obsession. Love me or hate me, that is the question. If you love me then Thank you! If you hate me then ...

  • HELP-LAST-QUESTION - FOR - NAT

    Dear All,
    I was reading my NAT Design Paper, because I am going to Implement NAT in My Company.
    Now, I want to ask you for only the Process of Static NAT , to allow External Users ? on internet side ? to ? access a specific server inside my LAN.
    Which is the things that determine this NAT will Work from External to Internal , or Internal to External ?
    Please answer the 3 questions .
    1- Is it the Route command that I configured on the router it self , only ?
    Or,
    2- Is it the Route Command + NAT Table which is configured on the Router it self ?
    Because As far as I know, I understood the following:-
    To configure the NAT, I have to:-
    1- determine which INTERFACE will act as IP NAT OUTSIDE , usually the one which have the IP from the ISP Side.
    2- Determine which INTERFACE will act as IP NAT INSIDE , usually the one which have the IP from the Private LAN.
    3- Determine the NAT statement , if its STATIC / dynamic /overloading .
    4- Determine the Route command .
    3- Here is Step 4 , I can make rule to forward every thing from INTERNAL to EXTERNAL or from EXTERNAL to INTERNAL , according to My Design Requirements.
    So, from the NAT Command + Route Command , I can make the NAT From External to Internal , or, from Internal to External . is that correct ?

    Hi!
    Good Day! I believe this would best answer your questions. Please check this link:
    http://www.cisco.com/en/US/products/sw/iosswrel/ps1839/products_feature_guide09186a0080087bae.html
    To verify, you can use "show ip nat translations" to display all ip address translations.
    HTH! Regards,
    Albert

  • Last question for the day - Music Video

    Hi,
    I have been asked by a friend to do their music video for them. I understand while shooting they will be playing to the original recording but after a day of shooting and im back at my computer what is the best way to syc my clips to the master audio track? Is there a tutorial available on music video creating? I know I could sit there and bit by bit move the clip to match however I am hoping there is a tutorial on it some place on the net.
    Thanks

    Hi
    Me just thinking
    I would
    • Make several full song recordings with my Camera (close-ups, full size etc.)
    or use several Cameras (5 to 10 recordings)
    Put the best Audio-uptake as a master Audio then add video clips to do the visual
    part as rythmic and paced fast/slow enough to reflect the "Air" of the lyrics.
    Know what I'm taking about - NO Not at all - just speculating.
    (With several Cameras - all recording non-stop - this would be much easier in
    FinalCut Pro and the MultiCamera function.)
    Yours Bengt W

  • When I go to history it only get the history for today, how do I get all history to appear

    I am trying to get all history instead of just the history of today. I want all the history to appear.

    Are you keeping the History?
    * Make sure that you do not use [[Clear Recent History]] to clear the Browsing History.
    * Make sure that the History is set to at least 1 day: Tools > Options > Privacy > History: "Remember visited pages for at least"
    * Make sure that you do not run Firefox in Private Browsing mode (Tools > Stop Private Browsing is grayed, see [[Private Browsing]])
    * To see History and Cookie settings in Tools > Options > Privacy, choose the setting "Firefox will: Use custom settings for history"
    You can look at these prefs on the about:config page.
    *http://kb.mozillazine.org/browser.history_expire_days (180) (also affects saved form data)
    *http://kb.mozillazine.org/browser.history_expire_days_min (90)
    See http://kb.mozillazine.org/about%3Aconfig

  • Questions for anyone who is familiar with Apple's Pages application

    I'm writing something on page layout software and have some questions about Apple's Pages product:
    Does Pages let you import native Photoshop files?
    Import native AI files with PDF preview?
    Regular PDF files?
    Does Pages let you work in CMYK?
    Spot colors?
    Spot and CMYK together?
    Export to PDF?
    You don't have to answer all these. I can use any help I can get.

    I just did a little testing. The current version of Pages in iWork 08 did better than I expected. It has both Word Processor and Page Layout modes. Page Layout mode lets you add real pages and word like a layout application.
    It places Photoshop and AI files with PDF preview, and the first page of a regular PDF file (I couldn't find where you could choose pages). Choose Insert > Choose. The Help says it accepts all QuickTime-supported file formats.
    "After importing an image into a document, you can mask (crop) it and change its brightness and other settings. You can place an image inside a shape, text box, chart element, or table cell. Pages also lets you work with graphics with transparency (alpha-channel graphics)."
    Also supports adding 2 and 3D charts, sounds, movies.
    I created objects and colored them with the CMYK sliders. I didn't see a way of choosing spot colors.
    PDF is one of the export formats (without the choices of course of InDesign). It correctly exported the PSD, AI file, and PDF. It correctly passed the spot colors in the AI and PDF files into the exported PDF. And the CMYK-colored pages objects came out in CMYK!
    Much better than Microsoft Word.

Maybe you are looking for

  • Spry menu Bar I.E. positioning issues?

    Hi, I, like many folks I've seen on various forums have the same problem with my spry menu appearing at the top of I.E browsers instead of under the menu bar. I've tried all sorts of fixes that I've found and have updated to the latest version of Spr

  • My iphone 4 will not connect to the internet is says i have no plan, but i do.

    My iphone says i have no internet plan, but i do. I called sprint and we tried everyway to make it work and it wouldn't.  It still says 3g on top but it just won't connect.  The only way it connects is if i connect to wifi.

  • Where can i get a press release picture for macbook 4.1

    Hi there, I'm writing for a Swedish Computer Magazine. I'm currently writing an article on how to improve performance on an aging Macbook 4.1. I've been trying to get ahold of someone at Apple who can provide me with some press images of a MacBook 4.

  • About keylistener

    i have a JFrame which i add a keylistener to it. After which i add a JPanel to the JFrame which contains JButton in it, the keylistener does not work anymore. The JButton needs to add keylistener in order for it to works. whats wrong with the keylist

  • HT2479 How can I get a clip to fast forward or slow down?

    I tried to fast forward a clip and it said it wasn't an option. I tried to do it with the instant replay and the slow motion and it didn't work as well. . How can I fix this?