Class that contains data for the Write event.
Inheritance: System.EventArgs
Exemplo n.º 1
0
 private void EventsScriptWrite(object sender, ScriptWriteEventArgs arguments)
 {
   Assert.AreEqual("write.id", arguments.Id);
   Assert.AreEqual(100, arguments.Image.Density.X);
   Assert.AreEqual(100, arguments.Image.Density.Y);
   Assert.AreEqual(DensityUnit.PixelsPerCentimeter, arguments.Image.Density.Units);
 }
Exemplo n.º 2
0
        private void ExecuteWrite(XmlElement element, IMagickImage image)
        {
            string fileName = element.GetAttribute("fileName");

            if (!string.IsNullOrEmpty(fileName))
            {
                image.Write(fileName);
            }
            else
            {
                if (Write == null)
                {
                    throw new InvalidOperationException("The Write event should be bound when the fileName attribute is not set.");
                }

                string id = element.GetAttribute("id");

                ScriptWriteEventArgs eventArgs = new ScriptWriteEventArgs(id, image);
                Write(this, eventArgs);
            }
        }
Exemplo n.º 3
0
 private void EventsScriptWrite(object sender, ScriptWriteEventArgs arguments)
 {
   Assert.AreEqual("write.id", arguments.Id);
   Assert.AreEqual(100, arguments.Image.ResolutionX);
   Assert.AreEqual(100, arguments.Image.ResolutionY);
 }
Exemplo n.º 4
0
 private static void OnScriptWrite(object sender, ScriptWriteEventArgs arguments)
 {
   arguments.Image.Write(SampleFiles.SnakewarePng);
 }
Exemplo n.º 5
0
    private void ExecuteWrite(XmlElement element, MagickImage image)
    {
      string fileName = element.GetAttribute("fileName");
      if (!string.IsNullOrEmpty(fileName))
      {
        image.Write(fileName);
      }
      else
      {
        if (Write == null)
          throw new InvalidOperationException("The Write event should be bound when the fileName attribute is not set.");

        string id = element.GetAttribute("id");

        ScriptWriteEventArgs eventArgs = new ScriptWriteEventArgs(id, image);
        Write(this, eventArgs);
      }
    }