ToString() public method

Returns a string that represents the current MagickGeometry.
public ToString ( ) : string
return string
Ejemplo n.º 1
0
        private static string Convert(MagickGeometry geometry)
        {
            if (geometry == null)
            {
                return(null);
            }

            return(geometry.ToString());
        }
Ejemplo n.º 2
0
        private INativeInstance CreateNativeInstance()
        {
            string format   = GetFormat();
            string fileName = FileName;

            if (!string.IsNullOrEmpty(fileName) && !string.IsNullOrEmpty(format))
            {
                fileName = format + ":" + fileName;
            }

            NativeMagickSettings instance = new NativeMagickSettings();

            instance.BackgroundColor   = BackgroundColor;
            instance.ColorSpace        = ColorSpace;
            instance.ColorType         = ColorType;
            instance.CompressionMethod = CompressionMethod;
            instance.Debug             = Debug;
            instance.Density           = Density != null?Density.ToString(DensityUnit.Undefined) : null;

            instance.Endian        = Endian;
            instance.Font          = _Font;
            instance.FontPointsize = _FontPointsize;
            instance.Format        = format;
            instance.Interlace     = Interlace;
            instance.Monochrome    = Monochrome;
            instance.Verbose       = Verbose;

            instance.SetColorFuzz(ColorFuzz);
            instance.SetFileName(fileName);
            instance.SetNumberScenes(NumberScenes);
            instance.SetPage(MagickGeometry.ToString(Page));
            instance.SetPing(Ping);
            instance.SetQuality(Quality);
            instance.SetScene(Scene);
            instance.SetScenes(Scenes);
            instance.SetSize(Size);

            foreach (string key in _Options.Keys)
            {
                instance.SetOption(key, _Options[key]);
            }

            return(instance);
        }
Ejemplo n.º 3
0
 internal static string ToString(MagickGeometry value)
 {
     return(value?.ToString());
 }
Ejemplo n.º 4
0
    public void Test_ToString()
    {
      MagickGeometry geometry = new MagickGeometry(10, 5);
      Assert.AreEqual("10x5", geometry.ToString());

      geometry = new MagickGeometry(-5, 5, 10, 20);
      Assert.AreEqual("10x20-5+5", geometry.ToString());

      geometry = new MagickGeometry(5, -5, 10, 20);
      Assert.AreEqual("10x20+5-5", geometry.ToString());

      geometry = new MagickGeometry(geometry.ToString());
      Assert.AreEqual(5, geometry.X);
      Assert.AreEqual(-5, geometry.Y);
      Assert.AreEqual(10, geometry.Width);
      Assert.AreEqual(20, geometry.Height);
    }