Esempio n. 1
0
        public QRDialog(AC.Pattern pattern)
        {
            this.pattern = pattern;
            qrImage = CreateQRCode(pattern, 3);

            InitializeComponent();
        }
Esempio n. 2
0
        public AC.Pattern GetPattern()
        {
            AC.Pattern pattern = new AC.Pattern();

            for (int i = 0; i < AC.Pattern.Width; i++)
                for (int j = 0; j < AC.Pattern.Height; j++)
                    pattern.Data[i, j] = pixels[i, j];

            pattern.ColorPalette = new AC.Palette();
            Array.Copy(palette.Colors, pattern.ColorPalette.Colors, pattern.ColorPalette.Colors.Length);

            pattern.Author = new AC.User();
            pattern.Title = "Untitled";

            return pattern;
        }
Esempio n. 3
0
        private void LoadPattern(AC.Pattern pattern)
        {
            currentPattern = pattern;

            titleText.Text = pattern.Title;
            authorNameText.Text = pattern.Author.Name;
            authorTownText.Text = pattern.Author.Town;
            authorUniqueIDText.Text = string.Join(":", pattern.Author.UniqueID.Select(b => b.ToString("X2")));

            for (int i = 0; i < pattern.ColorPalette.Colors.Length; i++)
                paletteControl.Items[i] = AC.Palette.GetColorIndexByCode(pattern.ColorPalette.Colors[i]);

            patternPanel.BackgroundImageLayout = ImageLayout.None;
            patternPanel.BackgroundImage = RenderPattern(pattern, 8);

            titleText.Enabled = true;
            editColorsButton.Enabled = true;
            createQRButton.Enabled = true;
        }
Esempio n. 4
0
        public static Pattern CreateFromRawData(byte[] data)
        {
            Pattern pattern = new Pattern();
            pattern.LoadFromBytes(data);

            return pattern;
        }