Ejemplo n.º 1
0
        public override void Run()
        {
            try
            {
                Font   font = Resources.GetFont(Resources.FontResources.GLANCEABLE);
                Bitmap bmp  = new Bitmap(Dimensions.Width, Dimensions.Height);

                uint[] flags =
                {
                    Bitmap.DT_WordWrap | Bitmap.DT_AlignmentLeft,
                    Bitmap.DT_WordWrap | Bitmap.DT_AlignmentCenter,
                    Bitmap.DT_WordWrap | Bitmap.DT_AlignmentRight,
                };


                string s = "Alas! poor Horatio. I knew him, my friend; a fellow of infinite jest, of most excellent fancy; he hath borne me on his back a thousand times; and now, where be your gibes now? your gambols? your songs? your flashes of merriment, that were wont to set the table on a roar? Not one now, to mock your own grinning? quite chapfallen? Now get you to my lady?s chamber, and tell her, let her paint an inch thick, to this favour she must come; make her laugh at that. Prithee, what say you?";

                for (int i = 0; i < flags.Length; i++)
                {
                    bmp.DrawRectangle((Presentation.Media.Color) 0xFF0000, 0, 0, 0, Dimensions.Width, Dimensions.Height, 0, 0, (Presentation.Media.Color) 0xFF0000, 0, 0, (Presentation.Media.Color) 0xFF0000, 0, 0, Bitmap.OpacityOpaque);

                    Presentation.Media.Color color = (Presentation.Media.Color) 0x0000FF;
                    bmp.DrawTextInRect(s, 0, 0, Dimensions.Width, Dimensions.Height, flags[i], color, font);

                    bmp.Flush();

                    Thread.Sleep(2000);
                }
                Pass = true;
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }
Ejemplo n.º 2
0
        public override void Run()
        {
            try
            {
                Bitmap bmp  = new Bitmap(Dimensions.Width, Dimensions.Height);
                Random rand = new Random();

                for (int i = 0; i < 1000; i++)
                {
                    Presentation.Media.Color fillColor = (Presentation.Media.Color)rand.Next(0xFFFFFF);
                    bmp.DrawRectangle((Presentation.Media.Color)rand.Next(0xFFFFFF), rand.Next(1),
                                      rand.Next(Dimensions.Width), rand.Next(Dimensions.Height), rand.Next(Dimensions.Width), rand.Next(Dimensions.Height), 0, 0, fillColor, 0, 0, fillColor, 0, 0, (ushort)rand.Next(256));
                    bmp.Flush();
                }
                Pass = true;
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }