Exemple #1
0
        private void ExportPNGfromPIX(byte[] data, string pixname, string output)
        {
            if (data == null)
            {
                return;
            }
            PIXFile px  = new PIXFile(data);
            string  dir = output;

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            if (px.headers.Count > 1)
            {
                dir += pixname;
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
                dir += "\\";
            }
            for (int i = 0; i < px.headers.Count; i++)
            {
                PIXFile.PIXHeader h    = px.headers[i];
                PIXFile.PIXData   d    = px.images[i];
                Bitmap            bmp  = PIXFile.MakeBitmap(h, d);
                string            name = MakeName(dir + Sanitize(h.name));
                bmp.Save(name);
                Log.WriteLine("Saved " + name);
            }
        }
Exemple #2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         int n = comboBox1.SelectedIndex;
         if (n == -1)
         {
             return;
         }
         PIXFile.PIXHeader h = currentPix.headers[n];
         PIXFile.PIXData   d = currentPix.images[n];
         pb1.Image = PIXFile.MakeBitmap(h, d);
     }
     catch { }
 }