protected Bitmap openPCX(string filePath, MyPCX pcxInfo)
 {
     if (pcxInfo == null)
         pcxInfo = new MyPCX();
     if (!pcxInfo.from(filePath))
     {
         MessageBox.Show(filePath, "開啟失敗");
         return null;
     }
     MessageBox.Show(filePath, "開啟成功");
     return pcxInfo.getView();
 }
 protected Bitmap openPCX(string filePath, MyPCX pcxInfo, PictureBox view, Dealing dealing)
 {
     if (pcxInfo == null)
         pcxInfo = new MyPCX();
     Bitmap output;
     if (!pcxInfo.from(filePath))
     {
         MessageBox.Show(filePath, "開啟失敗");
         return null;
     }
     output = dealing(pcxInfo.getView());
     view.Image = output;
     MessageBox.Show(filePath, "開啟成功");
     return output;
 }
Exemple #3
0
 private string[] PCXinfo(MyPCX thePCX)
 {
     string[] newLines = new string[info.Length];
     info.CopyTo(newLines, 0);
     newLines[0]  += "" + fileName;
     newLines[1]  += "" + thePCX.header.manufacturer;
     newLines[2]  += "" + thePCX.header.version;
     newLines[3]  += "" + thePCX.header.encoding;
     newLines[4]  += "" + thePCX.header.bitsPerPixel;
     newLines[5]  += "( " + thePCX.header.Xmin + " , " + thePCX.header.Ymin + " , " + thePCX.header.Xmax + " , " + thePCX.header.Ymax + " )";
     newLines[6]  += "( " + thePCX.header.Hdpi + " , " + thePCX.header.Vdpi + " )";
     newLines[7]  += "" + thePCX.header.nPlanes;
     newLines[8]  += "" + thePCX.header.bytesPerLine;
     newLines[9]  += "" + thePCX.header.paletteInfo;
     newLines[10] += "( " + thePCX.header.hScreenSize + " , " + thePCX.header.vScreenSize + " )";
     return(newLines);
 }
        protected void openPCX_Ref(string filePath, PictureBox pictureBox)
        {
            fileName = filePath;
            MyPCX thePCX = new MyPCX();

            if (!thePCX.from(filePath))
            {
                MessageBox.Show(filePath, "開啟失敗");
                return;
            }
            if (pictureBox.Image != null)
            {
                pictureBox.Image.Dispose();
                pictureBox.Image = null;
            }
            refView          = thePCX.getView();
            pictureBox.Image = refView;
            MessageBox.Show(filePath, "開啟成功");
        }
 protected Bitmap openPCX(string filePath, MyPCX pcxInfo, PictureBox view)
 {
     return openPCX(filePath, pcxInfo, view, nondealing);
 }