How to make a loading circle?

Hi there.
I want to do a loading circle in Expression Design (or Blend), but I don't really know how though. So I though I could ask in the expression forum =). What I mean by "loading circle", here's a good code project article showing the different types of loading circle. But I more for the circular gradient (top one) and I think Yahoo Messenger for Vista have that kind of loading circle as well (don't have screenshot of it though).
Hope you understand.
Thanks in advance.
/Joakim.

class LoadingCircle : Control,IDisposable
        private const double NumberOfDegreesInCircle = 360;
        private const double NumberOfDegreesInHalfCircle = NumberOfDegreesInCircle / 2;
        private const int DefaultInnerCircleRadius = 8;
        private const int DefaultOuterCircleRadius = 10;
        private const int DefaultNumberOfSpoke = 10;
        private const int DefaultSpokeThickness = 4;
        private readonly Color DefaultColor = Color.DarkGray;
        private const int IE7InnerCircleRadius = 8;
        private const int IE7OuterCircleRadius = 9;
        private const int IE7NumberOfSpoke = 24;
        private const int IE7SpokeThickness = 4;
        private Timer m_Timer;
        private bool m_IsTimerActive;
        private int m_NumberOfSpoke;
        private int m_SpokeThickness;
        private int m_ProgressValue;
        private int m_OuterCircleRadius;
        private int m_InnerCircleRadius;
        private PointF m_CenterPoint;
        private Color m_Color;
        private Color[] m_Colors;
        private double[] m_Angles;
        [TypeConverter("System.Drawing.ColorConverter"),
      Category("LoadingCircle"),
      Description("Sets the color of spoke.")]
        public Color Color
            get
                return m_Color;
            set
                m_Color = value;
                GenerateColorsPallet();
                Invalidate();
        [System.ComponentModel.Description("Gets or sets the radius of outer circle."),
        System.ComponentModel.Category("LoadingCircle")]
        public int OuterCircleRadius
            get
                if (m_OuterCircleRadius == 0)
                    m_OuterCircleRadius = DefaultOuterCircleRadius;
                return m_OuterCircleRadius;
            set
                m_OuterCircleRadius = value;
                Invalidate();
        [System.ComponentModel.Description("Gets or sets the radius of inner circle."),
        System.ComponentModel.Category("LoadingCircle")]
        public int InnerCircleRadius
            get
                if (m_InnerCircleRadius == 0)
                    m_InnerCircleRadius = DefaultInnerCircleRadius;
                return m_InnerCircleRadius;
            set
                m_InnerCircleRadius = value;
                Invalidate();
        [System.ComponentModel.Description("Gets or sets the number of spoke."),
        System.ComponentModel.Category("LoadingCircle")]
        public int NumberSpoke
            get
                if (m_NumberOfSpoke == 0)
                    m_NumberOfSpoke = DefaultNumberOfSpoke;
                return m_NumberOfSpoke;
            set
                if (m_NumberOfSpoke != value && m_NumberOfSpoke > 0)
                    m_NumberOfSpoke = value;
                    GenerateColorsPallet();
                    GetSpokesAngles();
                    Invalidate();
        private double[] GetSpokesAngles(int _intNumberSpoke)
            double[] Angles = new double[_intNumberSpoke];
            double dblAngle = (double)NumberOfDegreesInCircle / _intNumberSpoke;
            for (int shtCounter = 0; shtCounter < _intNumberSpoke; shtCounter++)
                Angles[shtCounter] = (shtCounter == 0 ? dblAngle : Angles[shtCounter - 1] + dblAngle);
            return Angles;
        private void GetSpokesAngles()
            m_Angles = GetSpokesAngles(NumberSpoke);
        [System.ComponentModel.Description("Gets or sets the number of spoke."),
      System.ComponentModel.Category("LoadingCircle")]
        public bool Active
            get
                return m_IsTimerActive;
            set
                m_IsTimerActive = value;
                ActiveTimer();
        [System.ComponentModel.Description("Gets or sets the thickness of a spoke."),
        System.ComponentModel.Category("LoadingCircle")]
        public int SpokeThickness
            get
                if (m_SpokeThickness <= 0)
                    m_SpokeThickness = DefaultSpokeThickness;
                return m_SpokeThickness;
            set
                m_SpokeThickness = value;
                Invalidate();
        private void ActiveTimer()
            if (m_IsTimerActive)
                m_Timer.Start();
            else
                m_Timer.Stop();
                m_ProgressValue = 0;
            GenerateColorsPallet();
            Invalidate();
        [System.ComponentModel.Description("Gets or sets the rotation speed. Higher the slower."),
        System.ComponentModel.Category("LoadingCircle")]
        public int RotationSpeed
            get
                return m_Timer.Interval;
            set
                if (value > 0)
                    m_Timer.Interval = value;
        private PointF GetCoordinate(PointF _objCircleCenter, int _intRadius, double _dblAngle)
            double dblAngle = Math.PI * _dblAngle / NumberOfDegreesInHalfCircle;
            return new PointF(_objCircleCenter.X + _intRadius * (float)Math.Cos(dblAngle),
                              _objCircleCenter.Y + _intRadius * (float)Math.Sin(dblAngle));
        public LoadingCircle()
            SetCircleAppearance(IE7NumberOfSpoke,
                          IE7SpokeThickness, IE7InnerCircleRadius,
                          IE7OuterCircleRadius);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            //ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            //   SetStyle(ControlStyles.ResizeRedraw, true);
            //  SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            m_Color = DefaultColor;
            GenerateColorsPallet();
            GetSpokesAngles();
            GetControlCenterPoint();
            m_Timer = new Timer();
            m_Timer.Tick += new EventHandler(aTimer_Tick);
            ActiveTimer();
            this.Resize += new EventHandler(LoadingCircle_Resize);
        private void GetControlCenterPoint()
            m_CenterPoint = GetControlCenterPoint(this);
        private PointF GetControlCenterPoint(Control _objControl)
            return new PointF(_objControl.Width / 2, _objControl.Height / 2 - 1);
        void LoadingCircle_Resize(object sender, EventArgs e)
            GetControlCenterPoint();
        void aTimer_Tick(object sender, EventArgs e)
            m_ProgressValue = ++m_ProgressValue % m_NumberOfSpoke;
            Invalidate();// GC.Collect();
        protected override void OnPaint(PaintEventArgs e)
        //    this.SetStyle(
        //     ControlStyles.AllPaintingInWmPaint |
        //     ControlStyles.DoubleBuffer, true);
            if (m_NumberOfSpoke > 0)
                e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
               e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
               e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
                int intPosition = m_ProgressValue;
                for (int intCounter = 0; intCounter < m_NumberOfSpoke; intCounter++)
                    intPosition = intPosition % m_NumberOfSpoke;
                    DrawLine(e.Graphics,
                             GetCoordinate(m_CenterPoint, m_InnerCircleRadius, m_Angles[intPosition]),
                             GetCoordinate(m_CenterPoint, m_OuterCircleRadius, m_Angles[intPosition]),
                             m_Colors[intCounter], m_SpokeThickness);
                    e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
                    e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
                    e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
                    DrawLine(e.Graphics,
                               GetCoordinate(m_CenterPoint, m_InnerCircleRadius - 4, m_Angles[intPosition]),
                               GetCoordinate(m_CenterPoint, m_OuterCircleRadius - m_OuterCircleRadius, m_Angles[intPosition]),
                             ColorTranslator.FromHtml("#2a2a2a"), 2); e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
                    intPosition++;
            base.OnPaint(e);
        private void DrawLine(Graphics _objGraphics, PointF _objPointOne, PointF _objPointTwo,
                             Color _objColor, int _intLineThickness)
            using (Pen objPen = new Pen(new SolidBrush(_objColor), _intLineThickness))
                objPen.StartCap = LineCap.Custom;
                objPen.EndCap = LineCap.NoAnchor;
                _objGraphics.DrawLine(objPen, _objPointOne, _objPointTwo);
        public override Size GetPreferredSize(Size proposedSize)
            proposedSize.Width =
                (m_OuterCircleRadius + m_SpokeThickness) * 2;
            return proposedSize;
        private Color Darken(Color _objColor, int _intPercent)
            int intRed = _objColor.R;
            int intGreen = _objColor.G;
            int intBlue = _objColor.B;
            return Color.FromArgb(_intPercent, Math.Min(intRed, byte.MaxValue), Math.Min(intGreen, byte.MaxValue), Math.Min(intBlue, byte.MaxValue));
        private void GenerateColorsPallet()
            m_Colors = GenerateColorsPallet(m_Color, Active, m_NumberOfSpoke);
        private Color[] GenerateColorsPallet(Color _objColor, bool _blnShadeColor, int _intNbSpoke)
            Color[] objColors = new Color[NumberSpoke];
            // Value is used to simulate a gradient feel... For each spoke, the 
            // color will be darken by value in intIncrement.
            byte bytIncrement = (byte)(byte.MaxValue / (NumberSpoke));
            byte PERCENTAGE_OF_DARKEN = 0;
            for (int intCursor = 0; intCursor < NumberSpoke; intCursor++)
                if (_blnShadeColor)
                    if (intCursor == 0 || intCursor < NumberSpoke - _intNbSpoke)
                        objColors[intCursor] = _objColor;
                    else
                        PERCENTAGE_OF_DARKEN += bytIncrement;
                        // Ensure that we don't exceed the maximum alpha
                        // channel value (255)
                        if (PERCENTAGE_OF_DARKEN > byte.MaxValue)
                            PERCENTAGE_OF_DARKEN = byte.MaxValue;
                        objColors[intCursor] = Darken(_objColor, PERCENTAGE_OF_DARKEN);
                else
                    objColors[intCursor] = _objColor;
            return objColors;
        public void SetCircleAppearance(int numberSpoke, int spokeThickness,
                   int innerCircleRadius, int outerCircleRadius)
            NumberSpoke = numberSpoke;
            SpokeThickness = spokeThickness;
            InnerCircleRadius = innerCircleRadius;
            OuterCircleRadius = outerCircleRadius;
            Invalidate();
        protected override void Dispose(bool disposing)
            base.Dispose(disposing);

Similar Messages

  • How to make udev load ALSA driver automaticly?

    I have added " modprobe snd-via82xx " (ALSA driver) to /etc/profile.d/mysh.sh, and I could use almost every multimedia software except mp3blaster.
    But after I installed udev, the udev load "via82cxxx_audio"  (OSS driver) automaticly instead of snd-via82xxx. mp3blaster can work now, but the esd output plug-in of XMMS could not work, so did stardict (is here anyone have ever used it?).
    I modprobe snd-via82xxx manually, but have no use.
    How to make OSS and ALSA work parallelly? And, how to make udev load ALSA automacticly instead of OSS?

    I have knew this method. What I mean is that the udev load OSS driver at boot. Although I modprobe the ALSA driver,  my software (stardict) can not play a wav sound (Other software can).
    I wants udev NOT to load OSS driver at boot. Or, it is the best, make OSS and ALSA work parallelly,

  • How to make a mangled circle smooth-edged again

    AI CS3.<br /><br />I'm fixing someone else's file. I've got a circle (filled with a gradient) into which an irregular shape (basically a square which was curved on the edge where it met the circle) was cut. The square had to be deleted (it contained a graphic we didn't want) which left me with a big white squarish space cut into the circle.<br /><br />I can move the two corner points that formed the square out to the edge of the circle, but I can't figure out how to make them curve points. Right now I've got a circle with some straight line segments that ruin the circular path.<br /><br />I knew how to do this in FreeHand. <grumble><br /><br />If someone can tell me how to do a Paste Into in Illustrator, I might be able to go back to my original file and paste the gradient into the irregular shape and match it up with the gradient in the circle.<br /><br />TIA,<br /><br />Marlene

    Marlene
    Are you sure you do not have a Compound Path that you can release?

  • How to make a checkbox circle transparent

    I would like to use acrobat to insert checkbox fields on a heathcare form such as the one below.  I would like the checkbox option to be a circle that would circle the number but be transparent to show the number below it.  This may not be possible but I thought I would see if anyone has an idea.  Thanks.

    AcroForms are the forms produced directly in Acrobat with the tools there. You can also get to Designer from Acrobat and create forms there. Once you go to Designer, you can not return to Acrobat for any editing since the Designer PDF is actually a XML package.
    It sounds like you may have used the same selections as I did in AcroForms, though I think you used a check box and not a radio box. I used radio boxes that are a circle by default. The check boxes are squares by default. The basic difference is that the check boxes are either independent (with different names) or identical (with identical names). The radio boxes are either independent (with different names) or only one can be selected at a time (with identical names). Thus, if you name a group of radio boxes with the same name, but different responses, selecting any one will deselect all others with the same name -- probably what you want -- and the response or the name will be the one you have selected. You can change to a square if you want. In AA9 and such, the form will come up with a choice for the user to highlight all fields, in which case there will be a transparent color (typically light blue) for all fields. You can still see through it. When you select a radio button, the number under it will be hidden by the selected icon -- probably OK to clarify a selection. You could always move it to one side if you want, but I think that is the limit of what you can do. The appearance would be a lot like a scan form you fill in with a #2 pencil (like SATs or GREs).
    I mentioned Designer since many folks get there without realizing it. Looks like you did not make it there, but you might want to explore that option on a copy of your form. Designer also has a separate forum named LiveCycle. The data files produced by AcroForms are typically FDF or XFDF (try exporting your data and look at the file differences). HTML is an option, but not as easy to use. Designer data files are XML files. The FDF, XFDF, and XML files can be imported to the form for printing/viewing/data management if you desire. There is no need to send the entire form, only the data. If you have the whole form sent, then you have to activate Reader Rights for users with Reader and come under the 500 use limit of the license (looks like that might be a problem for you, and the price to get around the limit is not something you really want to ask about unless you are flowing in cash).
    Many folks try to use e-mail for form submission. This is prone to problems of having an e-mail package recognized or the computer setup for MAPI, depending on the version of Acrobat and the OS. It is just a potential problem that can be avoided by a web script submission. Your IT folks should be able to help create a short web script to accept the data file and save it for you. With the FDF toolkit, you can also manipulate the FDF data file to extract what you need to a database or elsewhere. There are a lot of options, but you will likely come upon a few more form issues like the one you asked about that will require a bit of a rethink of how you create the form.
    Hopefully that answers your questions to some extent (even if not directly asked).

  • How to make Mac load as default instead of Windows

    When I reboot my computer, if I'm not watching carefully, my Windows partition will attempt to load XP. How can I make it so the Mac loads by default?
    Thanks!

    Use the Startup Disk control panel (Boot Camp control panel in XP).
    You should have inserted and installed the Mac OS X DVD while in Windows and run Apple Setup.exe.

  • HT201740 How to make an unfilled circle on Preview (new version)

    I'm not dealing well with the new version of Preview. Things seem so much harder and less intuitive.
    How can I make a non-filled circle?
    Many thanks

    Create a circle and set the fill to None.

  • How to make a round circle with the notch line

    Hi
    If I in Illustrator on the same layer make a Elipse with a 50pt stroke (blue color) and then i make 2 lines with a 20pt stroke (black color), so its lookslike a cross and rotate it 45 degr.
    Then i Outline the 3 elements "Outline Stroke" and align the 3 elements H and V Align Center.
    Now i want to cut the black lines out of the blue cirkel, so I get 4 pices with a "non-color" space between, but wjen i select the 3 elements and use Pathfinder -> Shape Modes, then i can't cut the lines out...
    What do i do wrong.
    What i want to end up with is something like this cirkel, so i can tage the 3 pices and give em another color.

    I did it this way.
    1) Ungroup a copy of a pie chart to disconnect the data.
    2) Draw a filled circle on top of the chart.
    3) Pathfinder Divide and delete the pieces in the centre.
    4) Select the remaining pieces and Object > Expand.
    5) Select just the expanded strokes and pathfinder Unite
    6) Pathfinder Divide and delete the United stroke.

  • How to make this loader? (Saw it from apple shuffle demo)

    Hi, how is this loader done?
    By animation or action scripts?Any tutorials for this?
    i attach an image*
    a direct link to see:
    http://203.211.138.133/siewna/yen/flash_load2.jpg
    Thanks!!!

    Thanks for your reply!
    I had reattached

  • How to make data loaded into cube NOT ready for reporting

    Hi Gurus: Is there a way by which data loaded into cube, can be made NOT available for reporting.
    Please suggest. <removed>
    Thanks

    See, by default a request that has been loaded to a cube will be available for reporting. Bow if you have an aggregate, the system needs this new request to be rolled up to the aggregate as well, before it is available for reporting...reason? Becasue we just write queries for the cube, and not for the aggregate, so you only know if a query will hit a particular aggregate at its runtime. Which means that if a query gets data from the aggregate or the cube, it should ultimately get the same data in both the cases. Now if a request is added to the cube, but not to the aggregate, then there will be different data in both these objects. The system takes the safer route of not making the 'unrolled' up data visible at all, rather than having inconsistent data.
    Hope this helps...

  • How do I make a loading screen like this one?

    Okay, so for my loading screen, I want a block to appear for every 10% loaded (so they'red be 10 blocks at the end).  I know how to make a loading bar, but I'm having trouble making this one.  Any help? Thanks.

    There are probably a number of ways to approach it.  One would be to have a movieclip with 10 frames where a new box is manually added in each frame.  You use the percent loaded information to tell that movieclip which frame to go to.

  • HOT TIP to make pages load faster (img background?)

    OK this obviously won't apple to everyone but... I managed to DRAMATICALLY reduce the page load time.
    Firstly, this tip is for you if you're using a background image on your page - in the content for example - where I'm using mine.
    iWeb, for some reason known only to the developers, creates a PNG image the COMPLETE size of your web page!
    So if you're site is 700px wide and you've got a lot of photos on a page then it could go say 3000px in height. iWeb will create a 700px X 3300px (or so) PNG with your background.
    THIS WAS 1.4MB!!!! for me..... absolutely crazy!
    They put in no-repeat on the background CSS.
    So how to fix this...
    It's actually quite easy
    1) Publish to a directory
    2) using photoshop or some other image editing tool that can open PNG files, open up the largest background_image1.png - largest being largest in px X px - e.g. 700 X 3300 is bigger than 700X1800
    3) crop the image in width from 700px to 5px - yep you read that right - crop it to 5px!
    (Now obviously this depends on the image you're using in the background but I am assuming that most images are patterns that repeat horizontally... if you have another image that repeats horizontally and is bigger than 5px then make the image as wide as your repeating image)
    4) save the image as a JPG
    5) open MassReplaceIt
    6) create a query where you replace /background_image1.png) no-repeat with /background_image1.jpg) repeat-x
    7) set it to update all HTML pages that use a background
    8) copy the JPG to all folders that have the background image (unfortunately as the folder name is different it's difficult to just put the image in the /images directory - and i don't know how to use wildcards in massreplaceit - any tips welcome)
    NOTE: I am using the same image background on all pages for consistency therefore I have the same filename - I am assuming that it's like that for everyone - the filename that is - so checkout that the replace will work for you.
    Well hope that helps you - I managed to reduce the page load times dramatically and now I can actually consider using iWeb for generating pages for my family in Australia who are still on 56Kbit modems and don't have broadband available.
    Cheers
    Jason

    http://www.websiteoptimization.com/services/analyze/wso.php?url=http://www.nmrtubes.com/
    Your entire home page is made entirely from
    images.....consider using some
    use of CSS and background colour, minimal graphics and some
    actual text, and
    you'll be a long way better off.
    Brendon
    "s.joy" <[email protected]> wrote in message
    news:ejfvjp$j0c$[email protected]..
    >I had posted this a couple days ago, but then wasn't
    available to check in
    > until now...so I'm reposting and this time I included my
    web address!
    >
    > Does anyone know how to make pages load faster? My page
    loads
    > incrementally at
    > the moment. The only images on my home page are .gifs so
    I'm wondering why
    > it
    > still comes in choppy when the files are so small. The
    address is
    > www.nmrtubes.com
    >

  • How to make it to move

    hey
    here is a example that can draw 2 circles and 1 oval. I want to know how to make the second circle round with the first circle aloong oval.
    thank you
    fay
    [email protected]
    Attachments:
    Picture4.vi ‏40 KB

    The blue circle should be drawn as last element, using a loop. You just need to calculate the postion of the center. Quite easy if you use polar coordinates, since an ellipse equation is simply
    x = a sin Alpha + xoffset
    y = b cos Alpha + yoffset
    where a and b are the semi-axis of the ellipse.
    I have modified your vi accordingly. There is still some tunning to be done on the x and y offset, since the ellipse is not centered on the central circle.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Picture4[1].vi ‏51 KB

  • HT201274 After doing this my iPhone got stoke in the loading circle. How can I make it work again?

    After doing this my iPhone got stoke in the loading circle. How can I make it work again?

    Try connecting it to your computer and restoring it by going to the Summary tab of your iTunes sync settings and clicking on Restore (see http://support.apple.com/kb/HT1414).  If that doesn't work you'll have to put it into recovery mode and restore it, as described here: http://support.apple.com/kb/ht1808.

  • How to make arrays or repeat objects in circle?

    Hello,
    1 - How to make arrays without copying and pasting? Fig-1
    2 - how to create objects repeated in circles? Fig-2
    Regards and Thanks

    1) Patterns
    2) One option is Scripting (or Actions).
    http://forums.adobe.com/message/3472806#3472806
    Edit: That was only for text layers, you could give this a try:
    // xonverts to smart object, copies and rotates a layer;
    // for photoshop cs5 on mac;
    // 2011; use it at your own risk;
    #target photoshop
    ////// filter for checking if entry is numeric and positive, thanks to xbytor //////
    posNumberKeystrokeFilter = function() {
              this.text = this.text.replace(",", ".");
              this.text = this.text.replace("-", "");
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\-\.\d]/g, '');
    posNumberKeystrokeFilter2 = function() {
              this.text = this.text.replace(",", "");
              this.text = this.text.replace("-", "");
              this.text = this.text.replace(".", "");
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\-\.\d]/g, '');
              if (this.text == "") {this.text = "2"}
              if (this.text == "1") {this.text = "2"}
    var theCheck = photoshopCheck();
    if (theCheck == true) {
    // do the operations;
    var myDocument = app.activeDocument;
    var myResolution = myDocument.resolution;
    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var dlg = new Window('dialog', "set circle-radius for arrangement", [500,300,840,450]);
    // field for radius;
    dlg.radius = dlg.add('panel', [15,17,162,67], 'inner radius');
    dlg.radius.number = dlg.radius.add('edittext', [12,12,60,32], "30", {multiline:false});
    dlg.radius.numberText = dlg.radius.add('statictext', [65,14,320,32], "mm radius ", {multiline:false});
    dlg.radius.number.onChange = posNumberKeystrokeFilter;
    dlg.radius.number.active = true;
    // field for number;
    dlg.number = dlg.add('panel', [172,17,325,67], 'number of copies');
    dlg.number.value = dlg.number.add('edittext', [12,12,60,32], "30", {multiline:false});
    dlg.number.value.onChange = posNumberKeystrokeFilter2;
    dlg.number.value.text = "12";
    // buttons for ok, and cancel;
    dlg.buttons = dlg.add('panel', [15,80,325,130], '');
    dlg.buttons.buildBtn = dlg.buttons.add('button', [13,13,145,35], 'OK', {name:'ok'});
    dlg.buttons.cancelBtn = dlg.buttons.add('button', [155,13,290,35], 'Cancel', {name:'cancel'});
    // show the dialog;
    dlg.center();
    var myReturn = dlg.show ();
    if (myReturn == true) {
    // the layer;
              var theLayer = smartify(myDocument.activeLayer);
              app.togglePalettes();
    // get layer;
              var theName = myDocument.activeLayer.name;
              var theBounds = theLayer.bounds;
              var theWidth = theBounds[2] - theBounds[0];
              var theHeight = theBounds[3] - theBounds[1];
              var theOriginal = myDocument.activeLayer;
              var theHorCenter = (theBounds[0] + ((theBounds[2] - theBounds[0])/2));
              var theVerCenter = (theBounds[1] + ((theBounds[3] - theBounds[1])/2));
    // create layerset;
              var myLayerSet = myDocument.layerSets.add();
              theOriginal.visible = false;
              myLayerSet.name = theName + "_rotation";
    // create copies;
              var theNumber = dlg.number.value.text;
              var theLayers = new Array;
              for (var o = 0; o < theNumber; o++) {
                        var theCopy = theLayer.duplicate(myLayerSet, ElementPlacement.PLACEATBEGINNING);
                        theLayers.push(theCopy);
    // calculate the radius in pixels;
              var theRadius = Number(dlg.radius.number.text) / 10 * myResolution / 2.54;
              myDocument.selection.deselect();
    // get the angle;
              theAngle = 360 / theNumber;
    // work through the layers;
              for (var d = 0; d < theNumber; d++) {
                        var thisAngle = theAngle * d ;
                        var theLayer = theLayers[d];
    // determine the offset for outer or inner radius;
                        var theMeasure = theRadius + theHeight/2;
    //                    var theMeasure = theRadius + theWidth/2;
                        var theHorTarget = Math.cos(radiansOf(thisAngle)) * theMeasure;
                        var theVerTarget = Math.sin(radiansOf(thisAngle)) * theMeasure;
    // do the transformations;
                        rotateAndMove(myDocument, theLayer, thisAngle + 90, - theHorCenter + theHorTarget + (myDocument.width / 2), - theVerCenter + theVerTarget + (myDocument.height / 2));
    // reset;
    app.preferences.rulerUnits = originalUnits;
    app.togglePalettes()
    ////// function to determine if open document is eligible for operations //////
    function photoshopCheck () {
    var checksOut = true;
    if (app.documents.length == 0) {
              alert ("no open document");
              checksOut = false
    else {
              if (app.activeDocument.activeLayer.isBackgroundLayer == true) {
                        alert ("please select a non background layer");
                        checksOut = false
              else {}
    return checksOut
    ////// function to smartify if not //////
    function smartify (theLayer) {
    // make layers smart objects if they are not already;
              if (theLayer.kind != LayerKind.SMARTOBJECT) {
                        myDocument.activeLayer = theLayer;
                        var id557 = charIDToTypeID( "slct" );
                        var desc108 = new ActionDescriptor();
                        var id558 = charIDToTypeID( "null" );
                        var ref77 = new ActionReference();
                        var id559 = charIDToTypeID( "Mn  " );
                        var id560 = charIDToTypeID( "MnIt" );
                        var id561 = stringIDToTypeID( "newPlacedLayer" );
                        ref77.putEnumerated( id559, id560, id561 );
                        desc108.putReference( id558, ref77 );
                        executeAction( id557, desc108, DialogModes.NO );
                        return myDocument.activeLayer
              else {return theLayer}
    ////// radians //////
    function radiansOf (theAngle) {
              return theAngle * Math.PI / 180
    ////// rotate and move //////
    function rotateAndMove (myDocument, theLayer, thisAngle, horizontalOffset, verticalOffset) {
    // do the transformations;
    myDocument.activeLayer = theLayer;
    // =======================================================
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc3 = new ActionDescriptor();
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc3.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc4 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc4.putUnitDouble( idHrzn, idPxl, horizontalOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc4.putUnitDouble( idVrtc, idPxl, verticalOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc3.putObject( idOfst, idOfst, desc4 );
        var idAngl = charIDToTypeID( "Angl" );
        var idAng = charIDToTypeID( "#Ang" );
        desc3.putUnitDouble( idAngl, idAng, Number(thisAngle) );
    executeAction( idTrnf, desc3, DialogModes.NO );

  • HT1212 My daughter's iPod touch is stuck on a blank screen with the loading circle just going around and around. I tried to restore it, but it says I have to enter the passcode. I have the passcode, but as I said, there's nothing on the screen. How do I f

    My daughter's iPod Touch is stuck on a blank screen with that loading circle thing just going around and around. She said she was trying to duplicate an app or something, and all the the apps started shaking like when you delete them. I turned the iPod off, but it never turned back on completely. I tried to restore it, but it's saying that I have to enter the passcode. But, as I said, there's nothing on the sceen excect the circle thing. Please help!!!!!

    Start at # 3
    1-  iOS: Not responding or does not turn on
    2  Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    3 If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    4  Try on another computer                            
    5  If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar

Maybe you are looking for

  • What are the settings for web?

    What are the settings for web?

  • Lost text in smartshape cp8 version 8.0.1.242

    Hello, I've lost all text entered into smartshapes throughout the whole project, it only repears after selecting the shapes. If the shape is not selected before previewing or outputting the text stays hiden. Is there a solution or have I made a boobo

  • Help with updating software

    Hi fellas! Please hlp me with this problem.. everytime I want to update any app a message pop up saying that "I had no permission to write in the Library/Caches carpet"..Why!?!?!?!?!

  • How do I configure Tuxedo 8.1 with SQL Server 2005 database?

    Hi, Currently using Tuxedo 8.1 (64bit) on SUN Solaris 8. 1. I want to know whether I can configure a SQL Server 2005 database in my current Tuxedo domain? 2. Are there any BEA useful links for examples? 3. Known problems? Any other useful information

  • Adding Image to Simple Button Dynamically Using AS3

    Hi, I need some help trying to figure out how to dynamically add an image (PNG or JPEG) that I can place in the library to a simple button also dynamically created in AS3. Is there a way to (1) add the image instead of using a text label and have it