0

Okay basically I need my application to increase an objects size and move it's location at the same time.

Basically, it'll increase the size, then drop it to a set value once it reaches a different set value. It needs to appear as though it's a growing shadow of an object. So you have an object on top set at a size of 32, 32 and a color of white. Then the second object is placed below the first object with the same size, but a color of gray. Now we increase the size of the second object, so that it appears like a growing shadow. However, like the sun getting closer, not letting the shadow increase in angle, only in size.

void dotFunction()
        {
            Color colorInt = label1.ForeColor;
            Color colorInt2 = label2.ForeColor;

            int sizeX = colorInt.R;
            int sizeY = colorInt.G;
            int locationX = colorInt2.R;
            int locationY = colorInt2.G;

            if (sizeX >= 80)
            {
                sizeX = 32;
                sizeY = sizeX;
                dotOneOut.Location = new System.Drawing.Point(31, 366);
            }

            else if (sizeX < 80)
            {
                sizeX++;
                sizeY++;
                locationX--;
                locationY--;

                if (locationX < 0)
                {
                    locationX = 0;
                }

                if (locationY < 0)
                {
                    locationY = 0;
                }
            }

            dotOneOut.Location = new System.Drawing.Point(locationX, locationY);
            dotOneOut.Size = new System.Drawing.Size(sizeX, sizeY);
            label1.ForeColor = Color.FromArgb(sizeX, sizeY, 1);
            label2.ForeColor = Color.FromArgb(locationX, locationY, 1);
        }

I can't figure it out... Please help...

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by lxXTaCoXxl
0

Okay here is my updated source. :D The problem is still the same but the source is a bit smaller saving a few cpu cycles later on down the road. :)

public int rotation = 0;
        public int sizeX;
        public int sizeY;
        public int locationX;
        public int locationY;

        void timerStart(object sender, EventArgs e)
        {
            myDecisionTimer.Start();
        }

        void applicationLaunch(object sender, EventArgs e)
        {
            myTimer.Start();
        }

        void decisionFunction(object sender, EventArgs e)
        {
                dotFunction();
        }

        void dotFunction()
        {

            if (sizeX >= 80)
            {
                sizeX = 32;
                sizeY = sizeX;
                dotOneOut.Location = new System.Drawing.Point(31, 366);
            }

            else if (sizeX < 80)
            {
                sizeX++;
                sizeY++;
                locationX--;
                locationY--;

                if (locationX < 0)
                {
                    locationX = 0;
                }

                if (locationY < 0)
                {
                    locationY = 0;
                }
            }

            dotOneOut.Location = new System.Drawing.Point(locationX, locationY);
            dotOneOut.Size = new System.Drawing.Size(sizeX, sizeY);
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.