示例#1
0
        /*
         * If I create a frame,  and set it to 16x32 the size will really be 16x32, but the way I coded this, you have
         * to invert it, so 16x32 would really be 32x16. It's the way the code works. So it's confusing just forget
         * I told you this, because you may accidently invert the actually size on the frame, and you dont want to do that.
         */
        public void RestoreFrame(uint xpos, uint ypos, Core.Graphics.Frame image)
        {
            //inverted.
            uint width  = (uint)image.Height;
            uint height = (uint)image.Width;

            if (width > height)
            {
                uint n = 0;
                for (uint x = 0; x < height; x++)
                {
                    for (uint y = 0; y < width; y++)
                    {
                        //Commented out this: xpos + x, ypos + y,
                        VGA.SetPixel320x200x8(xpos + x, ypos + y, image.GetPixel(n));
                        n += 1;
                    }
                }
            }
            if (width == height)
            {
                uint n = 0;
                for (uint x = 0; x < height; x++)
                {
                    for (uint y = 0; y < width; y++)
                    {
                        //Commented out this: xpos + x, ypos + y,
                        VGA.SetPixel320x200x8(xpos + x, ypos + y, image.GetPixel(n));
                        n += 1;
                    }
                }
            }
            if (width < height)
            {
                uint n = 0;
                for (uint y = 0; y < width; y++)
                {
                    for (uint x = 0; x < height; x++)
                    {
                        //Commented out this: xpos + x, ypos + y,
                        VGA.SetPixel(xpos + x, ypos + y, image.GetPixel(n));
                        n += 1;
                    }
                }
            }
        }
示例#2
0
 public static void drawArray(uint[] letter, uint x, uint y, uint color, ref Cosmos.Hardware.VGAScreen screen)
 {
     for (int i = 0; i <= letter.Length; i++)           //This is the Y
     {
         for (int j = 0; j <= letter.GetLength(0); j++) //This is X
         {
             if (letter[i].ToString().Substring(j, 1) == "1")
             {
                 screen.SetPixel320x200x8(x + (uint)j, y + (uint)i, color);
             }
             else if (letter[i].ToString().Substring(j, 1) == "2")
             {
             }
             else
             {
                 break;
             }
         }
     }
 }