Keresés

Új hozzászólás Aktív témák

  • #hpq

    aktív tag

    válasz Zalanius #7991 üzenetére

    Szia!

    Nagyon köszönöm a segítséget, tényleg ez volt a gond, hogy nem abba az eseménybe írtam bele.
    A következő kérdésem az lenne, hogy egy hullámot szeretnék kirajzoltatni de, nem működik akár mennyire próbálkozom és nem jövök rá hol lehet a probléma.

    Nagyon szépen köszönöm az eddigi munkádat és segítségedet, nagy szükség volt rá! :R

    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;

    namespace WindowsFormsApp6
    {
    public partial class Form1 : Form
    {
    public Color szín = Color.Red;

    //függvényeim
    public void Kör(Bitmap bmp, int x0, int y0, int r, double alfa1, double alfa2, Color szín)
    {

    double num1 = 1.0 / (double)r;
    int num2 = alfa1 - alfa2 < 0.0 ? 1 : -1;
    double num3 = alfa1;
    while ((double)num2 * num3 <= (double)num2 * alfa2)
    {
    int num4 = (int)((double)r * Math.Cos(num3));
    int num5 = (int)((double)r * Math.Sin(num3));

    if (!this.checkBox1.Checked)
    this.Refresh();
    num3 += (double)num2 * num1;
    }
    this.Refresh();
    }



    //eseményeim
    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
    }

    private void button1_Click(object sender, EventArgs e)
    {
    int x0 = 10;
    int y0 = 10;
    double alfa1 = 40;
    double alfa2 = 10;
    int r = 20;
    Kör((Bitmap)pictureBox1.Image, x0,y0,r,alfa1,alfa2,szín);
    }
    }
    }

Új hozzászólás Aktív témák