Esempio n. 1
0
 public void LirePalette(string fileName, Param param)
 {
     if (SauveImage.LirePalette(fileName, this, param))
     {
         UpdatePalette();
         main.SetInfo("Lecture palette ok.");
     }
     else
     {
         main.SetInfo("Erreur lecture palette...");
     }
 }
Esempio n. 2
0
        public void SauvePng(string fileName, Param param)
        {
            if (BitmapCpc.modeVirtuel == 6)
            {
                string       singleName = Path.GetDirectoryName(fileName) + "\\" + Path.GetFileNameWithoutExtension(fileName);
                DirectBitmap bmpRaster  = new DirectBitmap(BmpLock.Bitmap.Width >> 1, BmpLock.Bitmap.Height >> 1);
                //DirectBitmap bmp4Cols = new DirectBitmap(BmpLock.Bitmap.Width >> 1, BmpLock.Bitmap.Height >> 1);
                RvbColor c2   = new RvbColor(0);
                int      posx = 0;
                for (int y = 0; y < bmpRaster.Height; y++)
                {
                    bool memoC = false;
                    for (int x = 0; x < bmpRaster.Width; x++)
                    {
                        RvbColor c = BmpLock.GetPixelColor(x << 1, y << 1);
                        for (int i = 0; i < 16; i++)
                        {
                            RvbColor p = BitmapCpc.RgbCPC[colMode5[y, i]];
                            if (p.r == c.r && p.v == c.v && p.b == c.b)
                            {
                                if (i > 2)
                                {
                                    //c = BitmapCpc.RgbCPC[colMode5[y, 3]];
                                    c2 = p;
                                    int start = memoC ? x & 0xFF8 : 0;
                                    memoC = true;
                                    for (int r = start; r < x; r++)
                                    {
                                        bmpRaster.SetPixel(r, y, c2);
                                    }

                                    //									posx = 0;
                                }
                                break;
                            }
                        }
                        //bmp4Cols.SetPixel(x, y, c);
                        bmpRaster.SetPixel(x, y, c2);
                        posx++;
                    }
                }
                bmpRaster.Bitmap.Save(singleName + "_Rasters" + ".png", System.Drawing.Imaging.ImageFormat.Png);
                bitmapCpc.CreeBmpCpcForceMode1(BmpLock);
                SauveImage.SauveScr(singleName + ".scr", bitmapCpc, this, param, false);
            }
            else
            {
                BmpLock.Bitmap.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
            }

            main.SetInfo("Sauvegarde image PNG ok.");
        }
Esempio n. 3
0
        public void SauveCmp(string fileName, Param param, string version = null)
        {
            bitmapCpc.CreeBmpCpc(BmpLock, colMode5);
            if (BitmapCpc.modeVirtuel >= 7)
            {
                SaveAnim sa = new SaveAnim(main, fileName, version, this, param);
                sa.DoSave(true);
                sa.Dispose();
            }
            else
            {
                SauveImage.SauveScr(fileName, bitmapCpc, this, param, true, version, colMode5);
            }

            main.SetInfo("Sauvegarde image compactée ok.");
        }
Esempio n. 4
0
        public void SauveEgx(string fileName, Param param)
        {
            int mode   = BitmapCpc.modeVirtuel;
            int model1 = mode == 3 ? 1 : 2;
            int model2 = mode == 3 ? 0 : 1;

            BitmapCpc.modeVirtuel = model1;
            if (fileName.ToUpper().EndsWith(".SCR"))
            {
                fileName = fileName.Substring(0, fileName.Length - 4);
            }

            bitmapCpc.CreeBmpCpc(BmpLock, colMode5, true, 0);
            SauveImage.SauveScr(fileName + "0.SCR", bitmapCpc, this, param, false);
            BitmapCpc.modeVirtuel = model2;
            bitmapCpc.CreeBmpCpc(BmpLock, colMode5, true, 1);
            SauveImage.SauveScr(fileName + "1.SCR", bitmapCpc, this, param, false);
            main.SetInfo("Sauvegarde des deux images CPC ok.");
            BitmapCpc.modeVirtuel = mode;
        }
Esempio n. 5
0
 public void SauvePalette(string fileName, Param param)
 {
     SauveImage.SauvePalette(fileName, this, param);
     main.SetInfo("Sauvegarde palette ok.");
 }
Esempio n. 6
0
 public void SauveScr(string fileName, Param param)
 {
     bitmapCpc.CreeBmpCpc(BmpLock, colMode5);
     SauveImage.SauveScr(fileName, bitmapCpc, this, param, false);
     main.SetInfo("Sauvegarde image CPC ok.");
 }