Exemplo n.º 1
0
        void buttonLoad_Click(object sender, EventArgs e)
        {
            const string SupportedExtensions = "*.sa4; *.png; *.jpg; *.bmp; *.gif; *.tif";

            using (var openDialog = new OpenFileDialog {
                Filter = "Images (" + SupportedExtensions + ")|" + SupportedExtensions
            })
            {
                if (openDialog.ShowDialog(this) == DialogResult.OK)
                {
                    if (Path.GetExtension(openDialog.FileName).Equals(".sa4", StringComparison.OrdinalIgnoreCase))
                    {
                        using (var stream = new FileStream(openDialog.FileName, FileMode.Open))
                        {
                            pictureBox1.Image?.Dispose();
                            pictureBox1.Image = ImageSerializer.LoadFromStream(stream).ToBitmap();
                        }
                    }
                    else
                    {
                        pictureBox1.Image = new Bitmap(openDialog.FileName);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void SerializeImages()
        {
            Image  colorFontImage           = LoadUwpAssetImage("ColorFont.png");
            string colorFontImageSerialized = ImageSerializer.Serialize(colorFontImage);

            Image  miniMarioImage           = LoadUwpAssetImage("MiniMario.png");
            string miniMarioImageSerialized = ImageSerializer.Serialize(miniMarioImage, true);
        }
Exemplo n.º 3
0
        void buttonOpen_Click(object sender, EventArgs e)
        {
            using (var openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = Resources.FileFilterImages;

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        var fileName = openFileDialog.FileName;
                        using (imageBoxSource.Controller?.SuspendUpdateVisualImage())
                        {
                            if (Path.GetExtension(fileName)?.Equals(".sa4", StringComparison.OrdinalIgnoreCase) ?? false)
                            {
                                CodedImage image;
                                using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                                {
                                    image = ImageSerializer.LoadFromStream(stream);
                                }
                                if (!string.IsNullOrEmpty(image?.SourceImageFileName) && File.Exists(image.SourceImageFileName))
                                {
                                    var choice = MessageBox.Show(
                                        string.Format(Resources.WizardLoadSourceImageInsteadOfScheme, fileName, image.SourceImageFileName),
                                        Resources.WizardLoadImage, MessageBoxButtons.YesNoCancel);

                                    switch (choice)
                                    {
                                    case DialogResult.Cancel:
                                        return;

                                    case DialogResult.Yes:
                                        fileName = image.SourceImageFileName;
                                        RestoreImageSettings(image);
                                        break;

                                    case DialogResult.No:
                                        Wizard.ImageSetter.SetNewImage(image);
                                        RestoreImageSettings(image);
                                        EnableControls();
                                        return;
                                    }
                                }
                            }

                            Wizard.LoadSourceImageFromFile(fileName);
                        }
                        EnableControls();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(Resources.ErrorCannotOpenFile + Environment.NewLine + ex.Message);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void TestSerialize()
        {
            var image = new CodedImage {
                Size = new Size(2, 3), SourceImageFileName = @"c:\Temp\Test Image.jpg"
            };

            image.CompletePalette();
            image[0, 0] = new CodedColor(1);
            image[0, 1] = new CodedColor(100);
            image[0, 2] = new CodedColor(2);
            image[1, 0] = new CodedColor(2);
            image[1, 1] = new CodedColor(100);
            image[1, 2] = new CodedColor(3);
            Assert.AreEqual(4, image.Palette.Count, "Precondition");

            var tempFileName = Path.GetTempFileName();

            try
            {
                using (var fs = new FileStream(tempFileName, FileMode.Create))
                {
                    image.SaveToStream(fs);
                }

                using (var fs = new FileStream(tempFileName, FileMode.Open))
                {
                    var reloadedImage = ImageSerializer.LoadFromStream(fs);

                    Assert.AreEqual(new Size(2, 3), reloadedImage.Size);
                    Assert.AreEqual(@"c:\Temp\Test Image.jpg", reloadedImage.SourceImageFileName);

                    Assert.IsNotNull(reloadedImage.Palette);
                    Assert.AreEqual(4, reloadedImage.Palette.Count);
                    Assert.IsTrue(reloadedImage.Palette[1] is CodedColor);
                    Assert.IsTrue(reloadedImage.Palette[2] is CodedColor);
                    Assert.IsTrue(reloadedImage.Palette[3] is CodedColor);
                    Assert.IsTrue(reloadedImage.Palette[100] is CodedColor);

                    Assert.AreEqual(new CodedColor(1), reloadedImage[0, 0]);
                    Assert.AreEqual(new CodedColor(100), reloadedImage[0, 1]);
                    Assert.AreEqual(new CodedColor(2), reloadedImage[0, 2]);
                    Assert.AreEqual(new CodedColor(2), reloadedImage[1, 0]);
                    Assert.AreEqual(new CodedColor(100), reloadedImage[1, 1]);
                    Assert.AreEqual(new CodedColor(3), reloadedImage[1, 2]);
                }
            }
            finally
            {
                if (File.Exists(tempFileName))
                {
                    File.Delete(tempFileName);
                }
            }
        }
Exemplo n.º 5
0
 public static IndexedImage GetImageResource(string resourceName)
 {
     using (var stream = GetRawResourceStream(resourceName))
     {
         if (stream != null)
         {
             return(ImageSerializer.LoadFromStream(stream));
         }
     }
     return(null);
 }
Exemplo n.º 6
0
        private static void ValidateImageSerializer()
        {
            Image originalImage = LoadUwpAssetImage("ColorFont.png");

            string serializedImage1   = ImageSerializer.Serialize(originalImage);
            string serializedImage2   = ImageSerializer.Serialize(originalImage, true);
            var    deserializedImage1 = ImageSerializer.Deserialize(serializedImage1);
            var    deserializedImage2 = ImageSerializer.Deserialize(serializedImage2);

            if (!ImagesEqual(originalImage, deserializedImage1, true) ||
                !ImagesEqual(originalImage, deserializedImage2, false))
            {
                throw new Exception("Image serialized failed.");
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Retrieves <see cref="CodedImage"/> from <see cref="IDataObject"/>.
        /// </summary>
        /// <param name="dataObject">DataObject to retrieve image from.</param>
        /// <returns>New CodedImage instance retrieved from DataObject if it has supported format, or null.</returns>
        public static CodedImage GetImageFromDataObject(IDataObject dataObject)
        {
            if (dataObject != null && dataObject.GetDataPresent(DataFormatType))
            {
                var data = dataObject.GetData(DataFormatType) as string;
                if (!string.IsNullOrEmpty(data))
                {
                    try
                    {
                        return(ImageSerializer.ReadFromString(data));
                    }
                    catch { }
                }
            }

            return(null);
        }
Exemplo n.º 8
0
        void homeUserControl_OpenButtonClicked(object sender, HomeUserControl.OpenFileEventArgs e)
        {
            try
            {
                CodedImage image;
                using (var stream = new FileStream(e.FileName, FileMode.Open, FileAccess.Read))
                {
                    image          = ImageSerializer.LoadFromStream(stream);
                    image.FileName = e.FileName;
                    Settings.Default.AddLastOpenFile(e.FileName);
                }

                ShowSchemeUserControl(image);
                homeUserControl?.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Resources.ErrorCannotOpenFile + Environment.NewLine + ex.Message);
            }
        }
Exemplo n.º 9
0
        public override void Run()
        {
            // A big thanks to Johan Vinet, pixel artist and animator, for the Mario animation! :-)
            // http://johanvinet.tumblr.com/
            // Twitter handle: @johanvinet

            // Get the pixels of the animation frames.
            // (The image below is serialized using the ImageSerializer.Serialize() method.)
            const string serializedImage =
                "ATAAAAAIAAAAAP///wD///8A//////8ATf//AE3//wBN///x6AD///8A////AP///wD//////wBN//8ATf//8ej//wBNAP///wD/" +
                "//8A////AP//////AE3//wBN///x6P//AE0A////AP///wD///8A//////8ATf//AE3//wBN///x6AD///8A////AP///wD/////" +
                "/wBN//8ATf//AE3//wBNAP///wD///8A////AP//////AE3//wBN//8ATf//AE0A////AP///wD///8A//////8ATf//AE3//wBN" +
                "//8ATf//AE0A////AP///wD//////wBN//8ATf//AE3//wBN//8ATQD///8A////AP//////AE3//wBN//8ATf//AE3//wBNAP//" +
                "/wD///8A//////8ATf//AE3//wBN//8ATf//AE0A////AP///wD//////wBN//8ATf//AE3//wBN//8ATQD///8A////AP//////" +
                "AE3//wBN//8ATf//AE3//wBNAP///wD/////q1I2///Mqv+rUjb/AAAA///MqgD///8A////AP//////zKr/q1I2/wAAAP//zKoA" +
                "////AP///wD///8A///////Mqv+rUjb/AAAA///MqgD///8A////AP///wD/////q1I2///Mqv+rUjb/AAAA///MqgD///8A////" +
                "AP////+rUjb/q1I2///Mqv+rUjb/AAAAAP///wD///8A/////6tSNv+rUjb//8yq/6tSNv8AAAAA////AP///wD/////q1I2///M" +
                "qv//zKr/q1I2/6tSNv//zKoA////AP//////zKr//8yq/6tSNv+rUjb//8yq/6tSNgD///8A///////Mqv//zKr/q1I2/6tSNv//" +
                "zKr/q1I2AP///wD/////q1I2///Mqv//zKr/q1I2/6tSNv//zKoA////AP////+rUjb/q1I2///Mqv//zKr/q1I2/6tSNgD///8A" +
                "/////6tSNv+rUjb//8yq///Mqv+rUjb/q1I2AP///wD///8A/////6tSNv//zKr//8yq///MqgD///8A////AP///wD//////8yq" +
                "///Mqv//zKr//8yqAP///wD//////wBN//8ATf//zKr//8yq///Mqv//zKoA////AP///wD///8A/////6tSNv//zKr//8yq///M" +
                "qgD///8A////AP///wD/////q1I2/6tSNv//zKr//8yqAP///wD///8A////AP////+rUjb/q1I2///Mqv//zKoA////AP///wD/" +
                "/////wBN//8ATf///yf/Ka3//x0rUwD///8A//////8ATf//AE3///8n/ymt//8prf///6MAAP//////8egA//////8ATf///yf/" +
                "Ka3//ymt////owD///HoAP///wD//////wBN//8ATf///yf/Ka3//x0rUwD///8A////AP////8prf///wBN//8ATf///yf/HStT" +
                "AP///wD///8A/////ymt////AE3//wBN////J/8dK1P///HoAP///wD//////wBN///x6P8prf//Ka3//x0rUwD///////HoAP//" +
                "//8prf//Ka3//ymt//8prf//HStT/4N2nAD/////fiVT/ymt//8prf//Ka3//ymt//8dK1MA////AP///wD//////wBN///x6P8p" +
                "rf//Ka3//x0rUwD///8A////AP////8prf//Ka3///8ATf//AE3///HoAP///wD/////q1I2/ymt//8prf//Ka3///8ATf//AE0A" +
                "////AP///wD///8A/////6tSNv+rUjb/fiVTAP///wD///8A////AP////9+JVMA////AP////+rUjYA////AP///wD///8A////" +
                "AP///wD///8A////AP////+rUjYA////AP///wD///8A/////6tSNv+rUjb/fiVTAP///wD///8A////AP////+rUjYA////AP//" +
                "//9+JVMA////AP///wD///8A////AP///wD///8A////AP////9+JVMA////";

            Image image = ImageSerializer.Deserialize(serializedImage);

            // Create a sprite map from the pixels.
            var spriteMap = new SpriteMap(image);

            // Keep track of the animation frame...
            int    animationIndex = 0;
            Sprite sprite         = spriteMap.GetSprite(animationIndex);

            // ...and when it's time to update it.
            TimeSpan frameDuration           = TimeSpan.FromMilliseconds(70);
            DateTime nextAnimationUpdateTime = DateTime.Now.Add(frameDuration);

            // Keep track of the location and orientation of the sprite.
            int spriteX = 0;
            int spriteY = 0;
            DisplayDirection direction      = DisplayDirection.Deg0;
            bool             flipHorizontal = false;
            bool             flipVertical   = false;

            while (true)
            {
                bool redrawSprite = false;

                //Is it time to update the animation ?
                if (DateTime.Now >= nextAnimationUpdateTime)
                {
                    // Yes. The next time to update is:
                    nextAnimationUpdateTime = DateTime.Now.Add(frameDuration);

                    // Needs to redraw the sprite.
                    redrawSprite = true;

                    // Select the next sprite index.
                    animationIndex++;
                    if (animationIndex >= 6)
                    {
                        animationIndex = 0;
                    }

                    // Pick out the sprite.
                    sprite = spriteMap.GetSprite(animationIndex);
                }

                if (SenseHat.Joystick.Update())                                                  // Has any of the buttons on the joystick changed?
                {
                    UpdatePosition(ref spriteX, ref spriteY);                                    // Move the sprite.

                    UpdateDrawingDirection(ref direction, ref flipHorizontal, ref flipVertical); // Re-orientate the sprite.

                    // Needs to redraw the sprite.
                    redrawSprite = true;
                }

                if (redrawSprite)
                {
                    SenseHat.Display.Clear();                     // Clear the screen.

                    // Draw the sprite.
                    sprite.Draw(SenseHat.Display, spriteX, spriteY, true, direction, flipHorizontal, flipVertical);

                    SenseHat.Display.Update();                     // Update the physical display.
                }

                // Take a short nap.
                Sleep(TimeSpan.FromMilliseconds(2));
            }
        }
 public void WillDeSerializeCorrectly()
 {
     var sourceBytes = ImageSerializer.GetImage("1.jpg");
     var result      = ImageSerializer.CreateImage(sourceBytes);
 }
        public override void Run()
        {
#if WINDOWS_UWP
            Image image = ImageSupport.GetImage(new Uri("ms-appx:///Assets/ColorFont.png"));
#else
            #region Serialized Image

            // The image below is serialized using the ImageSerializer.Serialize() method.
            // Please see the "SerializeImages" method in the RPi.SenseHat.Tools project.
            const string serializedImage =
                "AOICAAAJAAAAAAAA////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA" +
                "////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////" +
                "////////////AAAA////////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////" +
                "////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////////AAAA////////////////////////" +
                "////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA" +
                "////////////////////////////AAAA////////////////////////AAAA////////////////////////////AAAA////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////" +
                "////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////AAAA////////////////////AAAA////////////////////////////AAAA////////////////////AAAA////////////////////" +
                "////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////" +
                "////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////////AAAA////////////////////////////AAAA////////////////////////////" +
                "AAAA////////////////////////////AAAA////////////////////////AAAA////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////" +
                "////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////" +
                "////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////AAAA////////////////AAAA////////////////////////////AAAA////////////AAAA////////" +
                "////////////////////AAAA////////////////////////////////////AAAA////////////////////////////AAAA////////////////////////////AAAA////////////////////////////////AAAA////////////////////////////AAAA////" +
                "////////////////////////AAAA////////////////////////////////////AAAA////////////AAAA////////////////AAAA////////////////////////////////AAAA////////////////////////////////AAAA////////////////////////" +
                "////AAAA////////////////////////////AAAA////////////////////AAAA////////////////////AAAA////////////////////AAAA////////////////////AAAA/////////////////////////////wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "CgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCyCgCyCgCy/wD//wD/CgCyCgCyCgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCy" +
                "CgCy/wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD/CgCyCgCy/wD/" +
                "/wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCy" +
                "CgCyCgCyCgCyCgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy" +
                "CgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCy" +
                "CgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/CgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCy" +
                "/wD//wD//wD//wD/CgCy/wD//wD/CgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD/" +
                "/wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCyCgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCyCgCyCgCyCgCyCgCy/wD//wD//wD/" +
                "CgCyCgCyCgCyCgCy/wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD/CgCyCgCy/wD//wD/CgCy" +
                "CgCy/wD//wD//wD//wD//wD/CgCyCgCy/wD//wD//wD//wD/CgCyCgCy/wD//wD//wD/CgCy/wD//wD//wD/CgCyCgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/CgCyCgCyCgCy/wD//wD/CgCyCgCyCgCy/wD//wD//wD//wD//wD//wD//wD/" +
                "CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD/CgCyCgCy/wD//wD/CgCyCgCy/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGRwCGRwCG/wD//wD//wD/RwCGRwCGAAAAAAAARwCGRwCG" +
                "/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAARwCGRwCG/wD//wD//wD/RwCGRwCGAAAAAAAAAAAAAAAAAAAA/wD/RwCGRwCGAAAAAAAAAAAAAAAAAAAA/wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/" +
                "/wD/RwCGRwCGAAAAAAAA/wD//wD//wD//wD/RwCGRwCGAAAAAAAA/wD/RwCGRwCGAAAARwCGRwCGAAAAAAAA/wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD/RwCGRwCGRwCG/wD/RwCGRwCGRwCGAAAA/wD/RwCGRwCGRwCG/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA" +
                "AAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD//wD/AAAARwCGRwCGAAAAAAAAAAAA/wD/RwCGRwCGAAAA/wD/RwCG" +
                "RwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD//wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD//wD/AAAAAAAAAAAARwCGRwCGAAAA/wD//wD/RwCG/wD/AAAARwCG/wD/" +
                "/wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD/RwCG/wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD/RwCGRwCG/wD//wD/" +
                "/wD//wD//wD/RwCGRwCG/wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAA/wD//wD/AAAA/wD//wD//wD/" +
                "RwCG/wD//wD/RwCG/wD//wD//wD//wD//wD//wD/RwCG/wD/AAAAAAAA/wD/RwCGRwCG/wD//wD/RwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD//wD//wD/RwCGRwCGAAAA/wD//wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAA" +
                "AAAARwCGRwCG/wD//wD//wD//wD//wD/RwCGRwCGRwCGAAAA/wD/RwCGRwCGAAAAAAAAAAAAAAAAAAAA/wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCGRwCGAAAA/wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAAAAAARwCG" +
                "RwCG/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD//wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD//wD//wD/RwCGRwCGRwCGRwCGRwCG/wD//wD/" +
                "RwCGRwCGAAAA/wD/RwCGRwCGAAAA/wD/RwCGRwCGAAAAAAAARwCGRwCG/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCG/wD//wD//wD//wD//wD/RwCGRwCG/wD//wD/RwCGRwCG/wD//wD//wD/RwCGRwCG/wD//wD//wD/RwCGRwCG" +
                "/wD//wD//wD//wD//wD//wD//wD/RwCGRwCG/wD//wD/RwCGRwCG/wD//wD//wD//wD//wD//wD//wD//wD//wD/RwCGRwCGAAAAAAAAAAAA/wD//wD/AAAARwCGRwCG/wD//wD//wD//wD//wD/RwCGRwCGAAAAAAAA/wD//wD/RwCGRwCG/wD//wD//wD//wD/RwCG" +
                "RwCGAAAAAAAA/wD//wD/RwCGRwCG/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/ngBGngBGAAAAAAAAngBGngBG/wD//wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD//wD/AAAAAAAA/wD/ngBGngBG" +
                "AAAA/wD/ngBGngBG/wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGAAAA/wD//wD/AAAAAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGAAAA" +
                "/wD//wD/ngBGngBGngBGngBGAAAAAAAA/wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGngBGngBGngBGngBGngBGAAAA/wD/ngBGngBGngBGngBGngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA" +
                "/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD//wD/AAAAAAAA/wD//wD//wD/ngBGngBGAAAA/wD//wD//wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBG" +
                "ngBGAAAA/wD//wD/ngBGngBGAAAA/wD//wD/ngBGngBGngBGngBGAAAAAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD//wD//wD//wD/ngBGngBGAAAAAAAA/wD//wD//wD/ngBGngBG/wD/AAAA/wD//wD//wD//wD/ngBGngBG/wD//wD//wD//wD//wD/ngBG" +
                "ngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBGngBGngBG/wD//wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD//wD/ngBGngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBG" +
                "AAAA/wD//wD/ngBGngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD/ngBGngBGAAAA/wD//wD/" +
                "/wD//wD//wD//wD/ngBGngBGAAAA/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD//wD//wD/ngBGngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD/" +
                "ngBGngBGngBGngBGngBG/wD//wD//wD//wD/ngBGngBGngBGngBGngBG/wD//wD/ngBGngBGngBGngBGngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD//wD/ngBGngBG/wD//wD/ngBG" +
                "ngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBG/wD//wD/ngBGngBGngBGngBGngBGngBG/wD//wD/ngBGngBGngBGngBG/wD//wD//wD/ngBGngBGngBGngBG/wD//wD//wD//wD//wD/AAAA/wD//wD/AAAA/wD//wD//wD/ngBGngBGngBGngBG" +
                "/wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD/ngBGngBGAAAAngBGngBGngBGAAAA/wD//wD/ngBGngBGngBGAAAA/wD//wD//wD//wD/AAAAAAAA/wD/ngBGngBGAAAA/wD//wD/AAAAAAAA/wD/ngBGngBGAAAA/wD//wD//wD/ngBGngBGngBGngBGAAAA" +
                "/wD/ngBGngBGngBGngBGngBG/wD//wD//wD/ngBGngBGAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAAngBGngBGAAAAAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD/AAAAAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGAAAA/wD/ngBGngBGngBGngBGngBGngBGngBGngBG/wD//wD/ngBGngBGAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAAngBGngBGAAAAAAAA/wD//wD/ngBGngBGngBG" +
                "ngBGAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGngBGngBGAAAAAAAA/wD//wD/ngBGngBGAAAA/wD//wD/ngBGngBGAAAA/wD//wD//wD//wD//wD/ngBGngBGAAAAAAAA/wD//wD/" +
                "ngBGngBG/wD//wD//wD//wD//wD//wD//wD/ngBGngBGAAAAAAAA/wD//wD//wD//wD//wD//wD/ngBGngBG/wD//wD//wD/ngBGngBGAAAAAAAA/wD//wD//wD//wD/ngBGngBG/wD//wD/ngBGngBGAAAAAAAA/wD//wD//wD//wD/ngBGngBG/wD//wD/ngBGngBG" +
                "ngBGngBGngBGngBG/wD//wD//wD//wD//wD//wD//wD//wD/6wAP6wAP6wAP6wAP6wAP6wAPAAAA/wD/6wAP6wAP6wAP6wAP6wAPAAAAAAAA/wD/6wAP6wAPAAAA/wD//wD//wD//wD//wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAP6wAP6wAP/wD//wD/" +
                "/wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD//wD/6wAP6wAPAAAA6wAP6wAP6wAP/wD//wD/6wAP6wAP6wAP6wAP6wAP6wAPAAAA/wD//wD/6wAP6wAPAAAA/wD//wD//wD//wD//wD/6wAP6wAPAAAA/wD//wD/6wAP6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP" +
                "AAAA/wD//wD//wD//wD//wD/6wAP6wAPAAAA6wAPAAAA6wAP6wAPAAAA/wD/6wAP6wAP6wAP6wAP6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAP6wAP6wAP6wAPAAAAAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAP6wAP" +
                "6wAP6wAPAAAAAAAA/wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD//wD//wD/6wAP6wAPAAAA/wD//wD//wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA6wAP/wD/6wAP6wAPAAAA/wD//wD//wD/6wAP6wAP" +
                "AAAAAAAA/wD//wD//wD/6wAP6wAP6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAAAAAAAAAA" +
                "AAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD//wD/AAAAAAAA6wAP6wAP/wD//wD/6wAP6wAP6wAP6wAP6wAP/wD//wD//wD/6wAP6wAPAAAAAAAAAAAAAAAA/wD/6wAP6wAPAAAAAAAA6wAP6wAPAAAA/wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD//wD/6wAP" +
                "6wAPAAAAAAAAAAAA/wD/6wAP6wAPAAAAAAAA6wAP6wAPAAAA/wD/6wAP6wAP6wAP6wAP6wAP/wD//wD//wD/6wAP6wAP6wAP/wD//wD//wD//wD//wD/6wAP6wAP/wD//wD/6wAP6wAPAAAA6wAP6wAP/wD//wD//wD//wD/6wAP6wAPAAAA/wD//wD/6wAP6wAP6wAP" +
                "6wAP6wAP6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAA6wAP6wAPAAAA/wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAPAAAAAAAA" +
                "AAAAAAAAAAAA/wD//wD/AAAA6wAP6wAPAAAAAAAAAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA/wD/6wAP6wAPAAAA6wAP/wD/6wAP6wAPAAAA/wD//wD/6wAP6wAP6wAP6wAPAAAAAAAA/wD/6wAP6wAPAAAA/wD/6wAP" +
                "6wAPAAAA/wD//wD/AAAAAAAA6wAP6wAPAAAAAAAA/wD//wD/AAAAAAAA6wAP6wAP/wD//wD//wD/AAAAAAAA6wAP6wAP/wD//wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD/6wAP6wAPAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAP/wD//wD/6wAP6wAP/wD//wD/6wAP" +
                "6wAP6wAP/wD/6wAP6wAPAAAA/wD//wD//wD/6wAP6wAPAAAA/wD//wD//wD//wD//wD//wD/6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP6wAPAAAAAAAA/wD/6wAP6wAP/wD/AAAA6wAP6wAPAAAA/wD//wD/AAAAAAAAAAAA6wAP6wAP/wD//wD/6wAP6wAP6wAP" +
                "6wAP6wAP/wD//wD//wD//wD//wD/6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP6wAP6wAPAAAAAAAA/wD//wD/6wAP6wAP6wAP6wAP6wAPAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/6wAP6wAPAAAAAAAA/wD/6wAP6wAPAAAA/wD/" +
                "/wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/6wAP6wAPAAAAAAAA6wAP6wAPAAAAAAAA/wD//wD/6wAP6wAP6wAP6wAP/wD//wD//wD//wD//wD/6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP6wAPAAAAAAAA/wD//wD//wD/6wAP6wAP6wAP6wAP6wAP6wAP/wD/" +
                "/wD/6wAP6wAP6wAP6wAP6wAP6wAP/wD//wD/6wAP6wAP6wAP6wAP6wAP6wAP6wAP6wAP/wD//wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/6wAP6wAPAAAAAAAA/wD//wD//wD//wD/6wAP6wAP/wD//wD//wD//wD//wD/6wAP6wAPAAAAAAAA" +
                "/wD//wD//wD//wD//wD//wD//wD//wD/6wAP6wAP/wD//wD/6wAP6wAPAAAA/wD//wD//wD//wD//wD/6wAP6wAPAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD/" +
                "/xYA/xYAAAAAAAAA/xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAAAAAAAAAA/wD//wD//wD//xYA/xYAAAAAAAAAAAAA/wD//wD//wD//xYA/xYA" +
                "AAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYAAAAA/wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD//wD//xYA/xYA/xYA/xYA/wD//wD//wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD/AAAA/xYA" +
                "/xYAAAAA/wD//xYA/xYAAAAA/xYA/xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAAAAAAAAAAAAAA/wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYAAAAAAAAA/wD//wD//wD//wD/AAAAAAAA/xYA/xYA/wD/" +
                "/wD//wD//wD//xYA/xYAAAAA/wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYA/xYA/xYA/xYAAAAA/wD//wD//xYA/xYA/xYA/xYA/wD//wD//wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD/" +
                "/wD//xYA/xYAAAAAAAAA/wD//wD//wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYA/wD//wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA" +
                "/xYA/xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYA/xYA/xYAAAAA/wD//wD//xYA/xYAAAAA/wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA" +
                "/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYAAAAAAAAA/wD//wD//wD//xYA/xYAAAAA/wD//wD//xYA/xYA/xYA/xYA/xYA/xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA" +
                "AAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//wD/AAAAAAAA/wD//wD//xYA/xYA/xYA/xYA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD//wD//wD/" +
                "/xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYA/xYA/xYA/xYA/xYA/xYAAAAA/wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD//xYA" +
                "/xYA/xYA/xYA/xYAAAAA/wD//xYA/xYA/xYA/xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//xYA/xYA/xYA/xYA/xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYAAAAA/wD//wD//wD//xYA/xYAAAAA" +
                "/wD//wD//wD//wD//xYA/xYA/wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAA/xYA/xYA/wD//wD//xYA/xYA/xYA/xYA/xYA/xYA/xYA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//wD//wD//xYA/xYAAAAA/wD//wD/" +
                "/wD//xYA/xYAAAAAAAAA/xYA/xYA/wD//wD//wD//wD/AAAAAAAA/xYA/xYAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//xYA/xYA/xYA/xYA" +
                "/xYA/xYA/xYA/xYA/wD//wD//wD//wD/AAAAAAAA/xYA/xYA/wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD//wD//xYA/xYAAAAAAAAA/xYA/xYA/xYA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAA/xYA/xYAAAAAAAAAAAAA/wD//wD/AAAA/xYA" +
                "/xYA/xYA/xYAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//xYA/xYAAAAAAAAA/wD//wD//wD//wD//wD//wD//xYA/xYA/wD//wD//wD//wD//wD//xYA/xYA/wD//wD//wD//wD//wD//wD//wD//wD//xYA/xYAAAAAAAAA/wD/" +
                "/xYA/xYAAAAA/wD//wD//wD//wD//wD//xYA/xYAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//xYA/xYA/xYA/xYA/xYA/xYA/wD//wD//wD//wD//wD//wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD/" +
                "/04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04A/wD//wD//04A/04AAAAA/04A/04AAAAAAAAA/wD//04A/04AAAAA/wD//wD//wD//wD//wD//04A/04AAAAA/wD//wD//wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04A" +
                "AAAA/wD//wD//04A/04AAAAA/wD//wD//04A/04A/wD//04A/04AAAAA/wD//wD//04A/04AAAAA/04A/04A/wD//wD//wD//04A/04AAAAA/wD//wD//wD//wD//wD//04A/04AAAAA/wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A" +
                "/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//wD//wD//wD//wD//wD//04A/04A/04A/04AAAAAAAAA/wD//04A/04AAAAA/04A/04A/wD//wD//wD//04A/04A/wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA" +
                "/wD//04A/04AAAAA/wD//wD//04A/04A/04A/04AAAAAAAAA/wD//04A/04A/04AAAAA/04A/04A/04AAAAA/wD//04A/04AAAAAAAAA/04A/04A/wD//wD//wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAAAAAA/wD//wD//wD//wD//04A/04A/04A/04A" +
                "/04A/04AAAAA/wD//04A/04A/04A/04A/04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAAAAAAAAAA/wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/04A/04AAAAAAAAA/04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA" +
                "/wD//04A/04AAAAA/wD//wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAAAAAAAAAAAAAAAAAA/wD//wD//04A/04AAAAA/wD//wD//wD//wD//04A/04A/04A/04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//wD//04A/04A" +
                "AAAA/wD//wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/04A/04A/wD//wD//wD//wD//04A/04AAAAA/wD//wD//04A/04AAAAA/04AAAAA/04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04A" +
                "/04A/04A/04AAAAAAAAA/wD//wD//04A/04A/04A/04A/04AAAAA/wD//04A/04AAAAA/wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/04A/04A/wD//wD//wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//wD//04A/04A/04A" +
                "/04AAAAAAAAA/wD//wD//04A/04A/04A/04A/04AAAAAAAAA/wD//wD//04A/04A/04A/04A/wD//wD//wD//wD//04A/04A/04A/04A/04AAAAA/wD//wD//04A/04AAAAAAAAA/wD//wD//04A/04AAAAAAAAA/04A/04AAAAA/04A/04AAAAAAAAA/04A/04AAAAA" +
                "/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAAAAAAAAAAAAAAAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAAAAAA/wD//wD//wD//wD//04A" +
                "/04A/wD//wD//04A/04AAAAA/wD//wD/AAAAAAAAAAAA/04A/04AAAAAAAAA/04A/04A/wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA/wD//wD//wD//04A/04AAAAA/wD//04A/04AAAAA/wD//04A/04A/wD/" +
                "/wD//04A/04AAAAA/wD//04A/04A/wD//wD//wD//04A/04A/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//04A/04AAAAAAAAA/04A/04AAAAAAAAA/wD//04A/04A/04A/04A/04AAAAA" +
                "AAAA/wD//04A/04AAAAAAAAA/04A/04A/wD//wD//04A/04AAAAA/wD//04A/04AAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//04A/04AAAAA/wD//wD//wD//wD//04A/04AAAAAAAAA/04A/04A/wD//wD//wD//04A/04A/wD//wD//wD/" +
                "/04A/04A/wD//wD//wD//04A/04AAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//04A/04A/wD//wD//wD//wD//wD//04A/04A/wD//wD//wD//wD//wD//wD//04A/04AAAAAAAAA/wD//wD//wD//04A/04A/wD//wD//wD//wD//04A/04AAAAAAAAA/wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD/" +
                "/5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//5IA/5IAAAAA/wD//wD//wD//wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IA/5IA/5IA/wD//wD//wD//5IA/5IA/5IA" +
                "AAAAAAAA/wD//wD//5IA/5IAAAAA/wD//5IA/5IA/wD//wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//5IA/5IAAAAA/wD//wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IAAAAA/wD//wD/" +
                "/wD//wD//wD//wD//wD/AAAA/5IA/5IA/5IA/wD//wD//5IA/5IAAAAA/wD//5IA/5IA/wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//wD//5IA/5IAAAAA/wD//wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//wD//5IA/5IAAAAAAAAA/wD/" +
                "/wD//5IA/5IAAAAAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//wD//wD//5IA/5IAAAAA/wD//wD//wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//5IA/5IAAAAAAAAA/5IA/5IAAAAA/wD//5IA/5IAAAAAAAAA/5IA/5IAAAAA/wD/" +
                "/wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IA/5IA/5IA/5IAAAAA/wD//5IA/5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA/5IA/5IA/wD//wD//wD//5IA/5IA/5IA" +
                "/5IA/5IAAAAA/wD//wD//5IA/5IA/5IA/5IA/wD//wD//wD//wD//5IA/5IAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IA/5IA/5IA/wD//wD//wD//wD//5IA/5IAAAAA/wD//5IA/5IAAAAA" +
                "/wD//5IA/5IA/wD//wD//5IA/5IA/5IA/5IA/wD//wD//5IA/5IAAAAA/wD/AAAA/5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IAAAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAA/5IA/5IA" +
                "AAAA/wD//5IA/5IAAAAA/wD//wD//wD//wD//wD//5IA/5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//wD//wD//5IA/5IA/5IA/wD//wD//wD//5IA/5IA/5IA/5IA/5IAAAAA/wD//wD//wD//5IA/5IAAAAAAAAA/wD//wD//wD//5IA/5IAAAAA/5IA/5IAAAAA/wD/" +
                "/wD//5IA/5IAAAAAAAAA/5IA/5IA/wD//wD//wD//wD/AAAA/5IA/5IAAAAAAAAA/wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//5IA/5IA/5IA/5IA/5IAAAAA/wD//5IA/5IA/5IA/5IA/5IAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA" +
                "/5IA/5IA/wD//wD//wD//wD//5IA/5IA/5IA/5IA/5IAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//5IA/5IA/5IA/5IA/5IA/5IA/wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//wD//wD//wD//5IA" +
                "/5IAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//wD//5IA/5IAAAAA/wD//wD//wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//wD//5IA/5IA/5IA/5IAAAAAAAAA/wD//5IA/5IAAAAA/wD//wD//5IA/5IA" +
                "AAAA/wD//wD//wD//5IA/5IA/wD//wD//wD//wD//5IA/5IA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//5IA/5IAAAAA/wD//5IA/5IAAAAA/wD//wD//wD/AAAA/5IA/5IAAAAAAAAA/wD//wD//5IAAAAAAAAA/wD//5IA/5IAAAAA/wD//wD//5IA" +
                "/5IA/5IA/5IA/5IA/5IA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//5IA/5IAAAAA/wD//wD//5IA/5IAAAAA/wD//5IA/5IAAAAAAAAA/wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//5IA/5IA/wD//wD//wD//wD//wD//5IA/5IA/5IA/wD//wD//5IA/5IA/5IAAAAAAAAA/wD//wD//wD//wD//wD//5IA/5IA/wD//wD//5IA/5IAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAA" +
                "AAAAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD/" +
                "/wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAAAAAA/wD//wD/" +
                "AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD/AAAA" +
                "AAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAA" +
                "AAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD/" +
                "/wD//wD/AAAAAAAA/wD//wD//wD//9EA/9EA/9EA/9EA/9EAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAAAAAAAAAA/9EA/9EA/9EA/9EAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAAAAAAAAAA/wD//wD/" +
                "AAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//9EA/9EAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//9EA/9EAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD/AAAA" +
                "AAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD/AAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD/AAAAAAAA/wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//9EA/9EA/9EA" +
                "/9EAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAAAAAA" +
                "/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/" +
                "/wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD//wD/AAAAAAAAAAAAAAAA/wD//wD//wD/AAAAAAAA/wD//9EA/9EAAAAAAAAA/wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAA" +
                "AAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD//wD/AAAA/wD//wD//wD/AAAAAAAA/wD//wD//wD/AAAAAAAAAAAAAAAAAAAAAAAA/wD//wD//wD//wD//wD//wD/" +
                "/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//9EA/9EAAAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD//wD/" +
                "/wD//wD/AAAAAAAAAAAA/wD//wD/AAAAAAAAAAAA/wD//wD//wD//wD//wD//wD//wD/AAAAAAAA/wD//wD/AAAAAAAA/wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD//wD/";

            #endregion Serialized Image

            Image image = ImageSerializer.Deserialize(serializedImage);
#endif
            // Create the font from the image.
            MultiColorFont font = MultiColorFont.LoadFromImage(
                image,
                " ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖÉÜabcdefghijklmnopqrstuvwxyzåäöéü0123456789.,?!\"#$%&-+*:;/\\<>()'`=",
                Color.FromArgb(0xFF, 0xFF, 0x00, 0xFF));

            // Get the characters to scroll.
            IEnumerable <MultiColorCharacter> characters = font.GetChars(_scrollText);

            // Choose a background color (or draw your own more complex background!)
            Color backgroundColor = Color.FromArgb(0xFF, 0x00, 0x20, 0x00);

            // Create the character renderer.
            var characterRenderer = new MultiColorCharacterRenderer();

            // Create the text scroller.
            var textScroller = new TextScroller <MultiColorCharacter>(
                SenseHat.Display,
                characterRenderer,
                characters);

            while (true)
            {
                // Step the scroller.
                if (!textScroller.Step())
                {
                    // Reset the scroller when reaching the end.
                    textScroller.Reset();
                }

                // Clear the display.
                SenseHat.Display.Fill(backgroundColor);

                // Draw the scroll text.
                textScroller.Render();

                // Update the physical display.
                SenseHat.Display.Update();

                // Pause for a short while.
                Sleep(TimeSpan.FromMilliseconds(50));
            }
        }
Exemplo n.º 12
0
        private object Process(object obj, Machine machine)
        {
            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);
            ImageSerializer serializer = new ImageSerializer(writer);
            serializer.Serialize(obj);
            writer.Close();
            stream = new MemoryStream(stream.ToArray());
            BinaryReader reader = new BinaryReader(stream);

            ImageSerializer deserializer = new ImageSerializer(reader, machine);
            return deserializer.Deserialize();
        }
 private static byte[] GetImage(string imageName)
 {
     return(ImageSerializer.GetImage(string.Format(@"images\{0}", imageName)));
 }
 /// <summary>
 /// Initializes this class
 /// </summary>
 private void Awake()
 {
     // Allows this instance to behave like a singleton
     Instance = this;
 }
Exemplo n.º 15
0
        public static void Main(string[] args)
        {
            //// According http://msdn.microsoft.com/en-us/magazine/cc300474.aspx
            LifetimeServices.LeaseTime = TimeSpan.FromMinutes(10);
            LifetimeServices.RenewOnCallTime = TimeSpan.FromMinutes(15);
            LifetimeServices.SponsorshipTimeout = TimeSpan.FromMinutes(1);

            Machine machine = null;

            string imageloadname = GetImageFileName(args);

            if (imageloadname != null)
            {
                var stream = File.Open(imageloadname, FileMode.Open);
                var reader = new BinaryReader(stream);
                ImageSerializer serializer = new ImageSerializer(reader, null);
                machine = (Machine)serializer.Deserialize();
                Machine.SetCurrent(machine);
                reader.Close();

                object pgm = machine.GetGlobalObject("Program");

                if (pgm != null)
                {
                    IBehavior program = (IBehavior)pgm;
                    machine.SendMessage(program, "main", null, null);
                    return;
                }
            }
            else
                machine = new Machine();

            foreach (string arg in GetFileNames(args))
            {
                Loader ldr = new Loader(arg, new VmCompiler());
                try
                {
                    ldr.LoadAndExecute(machine);
                }
                catch (Exception ex)
                {
                    System.Console.Error.WriteLine(ex.Message);
                    System.Console.Error.WriteLine(ex.StackTrace);
                }
            }

            string imagesavename = GetOption("save", "s", args);

            if (imagesavename != null)
            {
                var stream = File.Open(imagesavename, FileMode.Create);
                var writer = new BinaryWriter(stream);
                ImageSerializer serializer = new ImageSerializer(writer);
                serializer.Serialize(machine);
                writer.Close();
                return;
            }

            Loader loader = new Loader(System.Console.In, new VmCompiler());

            while (true)
            {
                try
                {
                    loader.LoadAndExecute(machine);
                }
                catch (Exception ex)
                {
                    System.Console.Error.WriteLine(ex.Message);
                    System.Console.Error.WriteLine(ex.StackTrace);
                }
            }
        }
Exemplo n.º 16
0
        public void SerializeDeserializeObjectsWithCycle()
        {
            IObject obja = new BaseObject(null, 1);
            IObject objb = new BaseObject(null, 1);
            obja[0] = objb;
            objb[0] = obja;

            MemoryStream stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(stream);
            ImageSerializer serializer = new ImageSerializer(writer);

            serializer.Serialize(obja);
            serializer.Serialize(objb);

            writer.Close();
            stream = new MemoryStream(stream.ToArray());
            BinaryReader reader = new BinaryReader(stream);

            ImageSerializer deserializer = new ImageSerializer(reader, null);

            var resulta = deserializer.Deserialize();
            var resultb = deserializer.Deserialize();

            Assert.IsNotNull(resulta);
            Assert.IsInstanceOfType(resulta, typeof(IObject));

            var iobja = (IObject)resulta;
            Assert.IsNull(iobja.Behavior);
            Assert.AreEqual(1, iobja.NoVariables);

            Assert.IsNotNull(resultb);
            Assert.IsInstanceOfType(resultb, typeof(IObject));

            var iobjb = (IObject)resultb;
            Assert.IsNull(iobjb.Behavior);
            Assert.AreEqual(1, iobjb.NoVariables);

            Assert.AreEqual(iobja, iobjb[0]);
            Assert.AreEqual(iobjb, iobja[0]);
        }
Exemplo n.º 17
0
        void InitializeRecentFilesButtons(ToolTip toolTip)
        {
            if (string.IsNullOrEmpty(Settings.Default.LastOpenFiles))
            {
                var startupPath = Path.Combine(AppInfo.StartupPath, "Samples");
                if (!string.IsNullOrEmpty(startupPath) && Directory.Exists(startupPath))
                {
                    var sampleFileNames = Directory.GetFiles(startupPath, "*.sa4").Take(10);
                    Settings.Default.LastOpenFiles = string.Join(Settings.FilesSeparator.ToString(), sampleFileNames);
                    Settings.Default.Save();
                }
            }

            foreach (var fileName in Settings.Default.LastOpenFiles.Split(Settings.FilesSeparator))
            {
                if (File.Exists(fileName))
                {
                    IndexedImage image;
                    try
                    {
                        using (var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                        {
                            image = ImageSerializer.LoadFromStream(stream);
                        }
                    }
                    catch (IOException)
                    {
                        continue;
                    }

                    if (image != null && image.Size.Width > 0 && image.Size.Height > 0)
                    {
                        Bitmap bitmap;
                        if (image.Size.Width > 200 || image.Size.Height > 200)
                        {
                            var maxLength = Math.Max(image.Size.Width, image.Size.Height);
                            var newSize   = new Size(image.Size.Width * 200 / maxLength, image.Size.Height * 200 / maxLength);
                            bitmap = new ImageResampler().Resample(image, newSize, ImageResampler.FilterType.Box).ToBitmap();
                        }
                        else
                        {
                            bitmap = image.ToBitmap();
                        }

                        var imageButton = new FlatButton();
                        imageButton.Size       = new System.Drawing.Size(250, 250);
                        imageButton.Image      = bitmap;
                        imageButton.Text       = Environment.NewLine + Path.GetFileNameWithoutExtension(fileName);
                        imageButton.Tag        = fileName;
                        imageButton.TextAlign  = ContentAlignment.BottomCenter;
                        imageButton.ImageAlign = ContentAlignment.MiddleCenter;
                        imageButton.FlatAppearance.BorderSize = 0;
                        imageButton.Click += ImageButton_Click;

                        var tooltip = fileName + Environment.NewLine +
                                      string.Format(Resources.ImageInfoTooltip, image.Size.Width, image.Size.Height, image.Palette.Count);
                        toolTip.SetToolTip(imageButton, tooltip);

                        panelLastOpenFiles.Controls.Add(imageButton);
                    }
                }
            }
        }
Exemplo n.º 18
0
 private static BitmapImage GetImage(byte[] source)
 {
     return(ImageSerializer.CreateImage(source));
 }
Exemplo n.º 19
0
        public ViewModelLocator()
        {
            LocalizationManager.Provider = new ResourceLocalizationProvider();

            ImageSerializer.Setup();

            if (DesignMode.DesignModeEnabled)
            {
                return;
            }

            IUnityContainer unityContainer = new UnityContainer();

            unityContainer.RegisterInstance(
                new TaskFactory(new LimitedConcurrencyLevelTaskScheduler(1, s => ThreadPool.RunAsync(t => s()).Forget())),
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <GP.Utils.Mvvm.IDialogService, GP.Utils.Mvvm.DialogService>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterInstance(Messenger.Default,
                                            new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <ISettingsProvider, DefaultSettingsProvider>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IProcessManager, ProcessManager>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <INavigationService, NavigationService>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IOutlineGenerator, HtmlOutlineExporter>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IMindmapPrintService, MindmapPrintService>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IMindmapStore, MindmapStore>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IWin2DRendererProvider, ModernPastelRendererProvider>(
                new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IImportSource, FileImportSource>("File",
                                                                          new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IImporter, XMindImporter>("XMind",
                                                                   new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IImporter, MindappImporter>("Mindapp",
                                                                     new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExportTarget, FileExportTarget>("File",
                                                                          new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExportTarget, EmailExportTarget>("Email",
                                                                           new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExporter, ImageExporter>("Image",
                                                                   new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExporter, XMindExporter>("XMind",
                                                                   new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExporter, HtmlOutlineExporter>("HtmlOutline",
                                                                         new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <IExporter, MindappExporter>("Mindapp",
                                                                     new ContainerControlledLifetimeManager());
            unityContainer.RegisterType <MindmapsViewModel>(
                new PerResolveLifetimeManager());
            unityContainer.RegisterType <EditorViewModel>(
                new PerResolveLifetimeManager());

            unityContainer.BuildUp(this);

            Container = unityContainer;
        }