Example #1
0
    private void ReloadImage()
    {
        this.imageMatrix = this.image.Pixels;
        this.seamCarver  = null;
        this.Title       = "Algoritmi za slike";
        if (seamCarverThread != null)
        {
            seamCarverThread.Abort();
            seamCarverThread.Join();
        }
        seamCarverThread = new Thread(runSeamCarvingThread);
        seamCarverThread.Start();

        if (radioSeam.Active)
        {
            State = ProgramState.SeamCarving;
        }
        else if (radioStegano.Active)
        {
            State = ProgramState.Steganography;
        }
        else if (radioSifra.Active)
        {
            State = ProgramState.Cryptography;
        }
    }
Example #2
0
    private void runSeamCarvingThread()
    {
        // assignment is atomic
        this.Title      = "Algoritmi za slike (Seam carving precompute u toku...)";
        this.seamCarver = new Algorithms.SeamCarving(this.imageMatrix);
        this.Title      = "Algoritmi za slike";

        if (radioHor.Active)
        {
            selektor.Adjustment.Upper = image.Pixbuf.Width;
            selektor.Adjustment.Value = image.Pixbuf.Width;
            lblSeam.Text = "Širina:";
        }
        else
        {
            selektor.Adjustment.Upper = image.Pixbuf.Height;
            selektor.Adjustment.Value = image.Pixbuf.Height;
            lblSeam.Text = "Visina:";
        }

        EnableSeamCarving();
    }