コード例 #1
0
        private void Form1_DragDrop(object sender, DragEventArgs e)
        {
            string sFile = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];

            if (optWriteXMP.Checked)
            {
                string sOut = sFile.Substring(0, sFile.Length - 4) + "_tagged.png";
                XMP    xmp  = new XMP();
                string sXmp = xmp.Make(txName.Text, txDesc.Text, new string[] {
                    txTagsGen.Text, txTagsSrc.Text, txTagsChr.Text, txTagsArt.Text
                });
                xmp.WritePNG(sFile, sOut, sXmp);
                MessageBox.Show("Done!", "PNG-XMP",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
            if (optReadXMP.Checked)
            {
                XMP    xmp    = new XMP();
                byte[] buffer = File.ReadAllBytes(sFile);
                tags   t      = xmp.Read(buffer);
                MessageBox.Show("Tags:" + "\r\n" +
                                "Name: " + t.Titl + "\r\n" +
                                "Desc: " + t.Desc + "\r\n" +
                                "\r\n" +
                                "tGen: " + t.tGen + "\r\n" +
                                "tSrc: " + t.tSrc + "\r\n" +
                                "tChr: " + t.tChr + "\r\n" +
                                "tArt: " + t.tArt + "\r\n" +
                                "\r\n" +
                                "tOth: " + t.tOth);
            }
        }
コード例 #2
0
 private void cmBuild_Click(object sender, EventArgs e)
 {
     XMP    xmp = new XMP();
     string gen = xmp.Make(txName.Text, txDesc.Text, new string[] {
         txTagsGen.Text, txTagsSrc.Text, txTagsChr.Text, txTagsArt.Text
     });
 }