예제 #1
0
        public static OverlayDefinition LoadOverlay(XmlNode node)
        {
            OverlayDefinition ret = new OverlayDefinition();

            ret.filename = node.Attributes["filename"].Value;
            if (node.HasChildNodes)
            {
                XmlNode prop = node.FirstChild;
                ret.location.x = int.Parse(prop.Attributes["x"].Value);
                ret.location.y = int.Parse(prop.Attributes["y"].Value);
            }

            return (ret);
        }
예제 #2
0
 public void MergeOverlay(Graphics graphics, OverlayDefinition overlay)
 {
     using (Image layer = Image.FromFile(overlay.filename))
     {
         graphics.DrawImageUnscaled(layer, overlay.location.ToPoint());
     }
 }