Beispiel #1
0
        public static string TomoritMatrix(Kep matrix)
        {
            string tomoritettMatrix = "";

            foreach (KepSor sor in matrix)
            {
                tomoritettMatrix += TomoritSor(sor) + "\n";
            }

            return(tomoritettMatrix);
        }
Beispiel #2
0
        public static Kep KitomoritMatrix(string tomoritettKep)
        {
            Kep kitomoritettMatrix = new Kep();

            string[] sorok = tomoritettKep.Trim().Split('\n');
            foreach (string sor in sorok)
            {
                kitomoritettMatrix.Add(KitomoritSor(sor));
            }

            return(kitomoritettMatrix);
        }
Beispiel #3
0
        private void mentesMaskentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (bitmap != null)
            {
                DialogResult result = fajlMento.ShowDialog();

                if (result == DialogResult.OK)
                {
                    string fajlNev      = fajlMento.FileName;
                    string kiterjesztes = fajlNev.Split('.').Last();
                    string tartalom     = "";

                    if (kiterjesztes == "kep")
                    {
                        for (int y = 0; y < bitmap.Height; y++)
                        {
                            for (int x = 0; x < bitmap.Width; x++)
                            {
                                Color szin = bitmap.GetPixel(x, y);
                                tartalom += szin.R + ":" + szin.G + ":" + szin.B + " ";
                            }
                            tartalom += "\n";
                        }
                    }
                    else if (kiterjesztes == "tkep")
                    {
                        kep = new Kep();

                        for (int y = 0; y < bitmap.Height; y++)
                        {
                            kep.Add(new KepSor());
                            for (int x = 0; x < bitmap.Width; x++)
                            {
                                Color szin = bitmap.GetPixel(x, y);
                                kep[y].Add(Pixel.FromString(szin.R + ":" + szin.G + ":" + szin.B));
                            }
                        }

                        tartalom = Tomorito.TomoritMatrix(kep);
                    }

                    FajlbaKiir(fajlNev, tartalom);
                }
            }
        }
Beispiel #4
0
        // Segédfüggvények
        private static Bitmap KepBetolt(Kep kep)
        {
            int szelesseg = kep.First().Count;
            int magassag  = kep.Count;

            Bitmap vaszon = new Bitmap(szelesseg, magassag);

            for (int y = 0; y < magassag; y++)
            {
                KepSor sor = kep[y];
                for (int x = 0; x < szelesseg; x++)
                {
                    Pixel pixel = kep[y][x];
                    vaszon.SetPixel(x, y, pixel.ToColor());
                }
            }

            return(vaszon);
        }
        public MainViewModel()
        {
            #region Declaration

            Kep           = new Kep();
            Ige           = new Ige();
            Dal           = new Dal();
            Video         = new Video();
            IgeEszkozok   = new IgeEszkozok();
            KepEszkozok   = new KepEszkozok();
            DalEszkozok   = new DalEszkozok();
            VideoEszkozok = new VideokEszkozok();
            dalAdatok     = new List <Model.Dal>();
            kepAdatok     = new List <Model.Kep>();
            igeAdatok     = new List <Model.Igek>();

            model = new Model.Model()
            {
                Lapok         = Ige,
                LapokEszkozok = IgeEszkozok
            };

            content = new Model.ButtonContent()
            {
                DalButtonContent   = "Dalok",
                IgeButtonContent   = "Igék",
                KepButtonContent   = "Képek",
                VideoButtonContent = "Videók"
            };

            #endregion

            #region RelayCommands Declaration

            MiddleClickCommand = new RelayCommand <object>(Middle_Button);
            RightClickCommand  = new RelayCommand <object>(Right_Button);
            LeftClickCommand   = new RelayCommand <object>(Left_Button);

            #endregion
        }
Beispiel #6
0
        private void megnyitasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result = fajlMegnyito.ShowDialog();

            if (result == DialogResult.OK)
            {
                string kepFajl      = fajlMegnyito.FileName;
                string kiterjesztes = kepFajl.Split('.').Last();

                StreamReader file = new StreamReader(kepFajl);
                Kep          kep  = new Kep();

                if (kiterjesztes == "kep")
                {
                    while (!file.EndOfStream)
                    {
                        KepSor   pixelSor = new KepSor();
                        string   sor      = file.ReadLine();
                        string[] pixelek  = sor.Trim().Split(' ');
                        foreach (string pixel in pixelek)
                        {
                            pixelSor.Add(Pixel.FromString(pixel));
                        }
                        kep.Add(pixelSor);
                    }
                }
                else if (kiterjesztes == "tkep")
                {
                    string tomoritett = file.ReadToEnd();
                    kep = Tomorito.KitomoritMatrix(tomoritett);
                }

                file.Close();
                kepHelye.Image = KepBetolt(kep);
            }
        }
Beispiel #7
0
    public virtual ExitCode deployStarrSloppy()
    {
        var source = mostUptodateLibs();
        if (source == null) { println("Couldn't find neither pack nor palo nor lolo to deploy"); return -1; }

        println("Deploying starr upon ourselves...");
        var target = new Kep().project;
        var status = transplantFile(source + "lib/scala-library.jar", target + "/lib/scala-library.jar");
        status = deleteFile(target + "/lib/scala-library.jar.desired.sha1");
        status = status && transplantFile(source + "lib/scala-reflect.jar", target + "/lib/scala-reflect.jar");
        status = deleteFile(target + "/lib/scala-reflect.jar.desired.sha1");
        status = status && transplantFile(source + "lib/scala-compiler.jar", target + "/lib/scala-compiler.jar");
        status = deleteFile(target + "/lib/scala-compiler.jar.desired.sha1");
        return status;
    }