Witam
Bardzo proszę o pomoc. Musze zrobić jakąś grafikę z 3 pętlami i aby figura była cieniowana od np ciemnego żółtego do bardzo jasnego. Brakuje mi 2 pętli dla trójkąta prostokątnego i gwiazdy i nie mam pojęcia jak to zrobić. Oto kod,który zrobiłem.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
// FLAGA BOŚNI I HERCEGOWINY
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Bitmap obraz = new Bitmap(600, 304, PixelFormat.Format24bppRgb);
pictureBox1.Image = obraz;
Graphics graf = Graphics.FromImage(obraz);
//TŁO
for (int x = 0; x < obraz.Width; x++)
{
for (int y = 0; y < obraz.Height; y++)
{
double kolor = (y) / (499.0) * (255.0);
double blue = 255.0 - kolor;
obraz.SetPixel(x, y, Color.FromArgb((int)kolor, 80, (int)blue));
}
}
Point[] star =
{
new Point(0,-25),
new Point(6,-8),
new Point(24,-8),
new Point(9,3),
new Point(15,20),
new Point(0,9),
new Point(-15,20),
new Point(-9,3),
new Point(-24,-8),
new Point(-6,-8)};
Point[] tri =
{
new Point(160,0),
new Point(464,0),
new Point(464,304)};
graf.FillPolygon(Brushes.Yellow, tri);
graf.TranslateTransform(105, 0);
graf.FillPolygon(Brushes.White, star);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
graf.FillPolygon(Brushes.White, star);
graf.TranslateTransform(38, 38);
}
}
}
Z góry dziękuję za pomoc.