Ejemplo n.º 1
0
        /// <summary>
        /// This constructor gets all the pieces at once.
        /// </summary>
        /// <param name="rBitmapSmall"></param>
        /// <param name="rBitmap"></param>
        /// <param name="description"></param>
        /// <param name="rLargeSizeBitmap"></param>
        public MenuItem(Resources.BitmapResources rBitmapSmall,
                        Resources.BitmapResources rBitmap, string description,
                        Resources.BitmapResources rLargeSizeBitmap)
        {
            // Get the images from the resource manager.
            _imageSmall = Resources.GetBitmap(rBitmapSmall);
            _image      = Resources.GetBitmap(rBitmap);

            // Set the description.
            _description = description;

            // Create the step arrays for zooming in and out.
            _widthSteps  = new int[MenuItemPanel.maxStep];
            _heightSteps = new int[MenuItemPanel.maxStep];

            // Get the difference in size between the large and small images.
            int wDiff = _image.Width - _imageSmall.Width;
            int hDiff = _image.Height - _imageSmall.Height;

            // Pre-calculate the width and height values for scaling the image.
            for (int i = 1; i < MenuItemPanel.maxStep; i++)
            {
                _widthSteps[i]  = (wDiff / MenuItemPanel.maxStep) * i;
                _heightSteps[i] = (hDiff / MenuItemPanel.maxStep) * i;
            }

            // Set the large width and height based on one of the main icons.
            Bitmap bmp = Resources.GetBitmap(rLargeSizeBitmap);

            _largeWidth  = bmp.Width;
            _largeHeight = bmp.Height;
        }
Ejemplo n.º 2
0
        public override void Run()
        {
            try
            {
                Bitmap bmp = new Bitmap(Dimensions.Width, Dimensions.Height);

                Resources.BitmapResources[] bitmaps = new Resources.BitmapResources[]
                {
                    Resources.BitmapResources.Outlook0,
                    Resources.BitmapResources.Outlook1,
                    Resources.BitmapResources.Outlook2,
                };

                for (int i = 0; i < bitmaps.Length; i++)
                {
                    Bitmap src = Resources.GetBitmap(bitmaps[i]);

                    bmp.DrawImage(0, 0, src, 0, 0, src.Width, src.Height);
                    bmp.Flush();

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

                Resources.BitmapResources[] bitmaps = new Resources.BitmapResources[]
                {
                    Resources.BitmapResources.Outlook0,
                    Resources.BitmapResources.Outlook1,
                    Resources.BitmapResources.Outlook2,
                };

                for (int i = 0; i < bitmaps.Length; i++)
                {
                    Bitmap src = Resources.GetBitmap(bitmaps[i]);

                    for (int s = 0; s <= 800; s++)
                    {
                        int w = s * Dimensions.Width / 200;
                        int h = s * Dimensions.Height / 200;
                        int x = (Dimensions.Width - w) / 2;
                        int y = (Dimensions.Height - h) / 2;

                        bmp.StretchImage(x, y, src, w, h, 256);
                        bmp.Flush();
                    }

                    Thread.Sleep(3000);
                }
                Pass = true;
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }
Ejemplo n.º 4
0
 internal static Microsoft.SPOT.Bitmap GetBitmap(Resources.BitmapResources id)
 {
     return((Microsoft.SPOT.Bitmap)(Microsoft.SPOT.ResourceUtility.GetObject(ResourceManager, id)));
 }
Ejemplo n.º 5
0
 internal static System.Drawing.Bitmap GetBitmap(Resources.BitmapResources id)
 {
     return((System.Drawing.Bitmap)(ResourceManager.GetObject(((short)(id)))));
 }
Ejemplo n.º 6
0
		public override void Run()
		{
			try
			{                
				Bitmap bmp = new Bitmap( Dimensions.Width, Dimensions.Height );
                                
				Resources.BitmapResources[] bitmaps = new Resources.BitmapResources[]
				{
					Resources.BitmapResources.Outlook0,
					Resources.BitmapResources.Outlook1,
					Resources.BitmapResources.Outlook2,
				};

				for(int i = 0; i < bitmaps.Length; i++ )
				{
					Bitmap src = Resources.GetBitmap( bitmaps[i] );

					bmp.DrawImage( 0, 0, src, 0, 0, src.Width, src.Height );                    
					bmp.Flush();                    
                    
					Thread.Sleep( 3000 );
				}
				Pass = true;
			}
			catch(Exception e)
			{
				UnexpectedException( e );
			}
		}
Ejemplo n.º 7
0
		public override void Run()
		{
			try
			{
				Bitmap bmp = new Bitmap( Dimensions.Width, Dimensions.Height );

				Resources.BitmapResources[] bitmaps = new Resources.BitmapResources[]
				{
					Resources.BitmapResources.Outlook0,
					Resources.BitmapResources.Outlook1,
					Resources.BitmapResources.Outlook2,
				};

				for(int i = 0; i < bitmaps.Length; i++ )
				{
					Bitmap src = Resources.GetBitmap( bitmaps[i] );

					for(int s = 0; s <= 800; s++)
					{
						int w = s * Dimensions.Width / 200;
						int h = s * Dimensions.Height / 200;
						int x = (Dimensions.Width - w) / 2;
						int y = (Dimensions.Height - h) / 2;

						bmp.StretchImage( x, y, src, w, h, 256 );
						bmp.Flush();
					}

					Thread.Sleep( 3000 );
				}
				Pass = true;
			}
			catch (Exception e)
			{
				UnexpectedException( e );
			}
		}