How i draw a picture?

Aug 24, 2010 at 10:23 AM

Hi,

I have milestone 4 and want to draw a picture. I heard something from using numbers, but how it works. Its my first time to make an GUI, it would be nice if you explain every step :).

Coordinator
Aug 25, 2010 at 12:22 PM

Did you try searching this forum? You should.

Aug 25, 2010 at 1:00 PM

Of course i done that. But my picture is just red. What is wrong:

                uint[] symbol = 
                {
                    0, 1, 1, 1, 0,
                    4, 4, 4, 4, 4
                };
               
                for(int i = 0; i < 2; i++) //runter
                {
                    for(int t = 0, count = 0; t < 5; t++, count++) //breite
                    {
                        if (symbol[count] == 1)
                            VGAScreen.SetPixel(x1 + (uint)t, y1 + (uint)i, 1);
                        else if (symbol[count] == 2)
                            VGAScreen.SetPixel(x1 + (uint)t, y1 + (uint)i, 2); 
                    }
                }

Where i have to place the colors? i put them before the while loop, but the picture is just red. I put t into the while loop and the complete screen is flashing.

 

            VGAScreen.SetPaletteEntry(0, 0, 0, 0);
            VGAScreen.SetPaletteEntry(1, 0, 50, 0);
            VGAScreen.SetPaletteEntry(2, 30, 30, 30);
            VGAScreen.SetPaletteEntry(3, 0, 0, 30);
            VGAScreen.SetPaletteEntry(4, 64, 64, 64);
my colors

Aug 26, 2010 at 10:03 AM

you have you have a test to see if it equals to when u array contains 0s 1s and 4s lol

and 64 isnt an applicable rgb

Aug 26, 2010 at 10:26 AM
Edited Aug 26, 2010 at 10:26 AM

Oh, now i know how the code works :D

I this is the new version of the code. But  i just get a golden rectangle

pls help. Im sometimes such an idiot XD
                uint[] example =
{
0, 1, 1, 1, 0,
1, 2, 2, 2, 1,
1, 2, 2, 2, 1,
1, 2, 2, 2, 1,
0, 1, 1, 1, 0
};

for(int i = 0; i < 4; i++) //runter
{
for(int t = 0, count = 0; t < 5; t++, count++) // breite
{
if (example[count] == 0)
{
VGAScreen.SetPixel320x200x8(x1 + (uint)t, y1 + (uint)i, 0);
}
else if (example[count] == 1)
{
VGAScreen.SetPixel320x200x8(x1 + (uint)t, y1 + (uint)i, 5);
}
else if (example[count] == 2)
{
VGAScreen.SetPixel320x200x8(x1 + (uint)t, y1 + (uint)i, 3);
}
}
}
My colors:
            VGAScreen.SetPaletteEntry(0, 63, 63, 63);
VGAScreen.SetPaletteEntry(1, 0, 30, 0);
VGAScreen.SetPaletteEntry(2, 63, 63, 63);
VGAScreen.SetPaletteEntry(3, 10, 2, 55);
VGAScreen.SetPaletteEntry(4, 35, 35, 35);
VGAScreen.SetPaletteEntry(5, 45, 30, 0);

Jun 12, 2012 at 11:47 AM

Thanxx Dude ! But the above code has some error that u have 2 replace y1 2 Y and put this code in new cs file with a new public static void Logo(uint X,uint Y)

Jun 15, 2012 at 2:10 AM

use v87612. M4 is anchient.