示例#1
0
        private bool LoadOld()
        {
            var updateSource = SavePath.Replace(".tmp", "");

            if (!File.Exists(updateSource))
            {
                Log.ErrorFormat("There is no gem file that can be updated (path: {0})", updateSource);
                return(false);
            }
            ItemDB.LoadFromCompletePath(updateSource);
            return(true);
        }
示例#2
0
        private void button4_Click(object sender, EventArgs e)
        {
            string SavePath;

            if (this.PicturePath != null)
            {
                SavePath = System.IO.Path.GetDirectoryName(this.PicturePath) + "\\" + System.IO.Path.GetFileNameWithoutExtension(this.PicturePath);
            }
            else
            {
                SavePath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
                SavePath = System.IO.Path.GetDirectoryName(SavePath);
                SavePath = SavePath.Replace("file:\\", "");
            }

            this.pictureBox19.Image.Save(SavePath + "_letter1.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox17.Image.Save(SavePath + "_letter2.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox18.Image.Save(SavePath + "_letter3.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox16.Image.Save(SavePath + "_letter4.png", System.Drawing.Imaging.ImageFormat.Png);
        }
示例#3
0
        private void button3_Click(object sender, EventArgs e)
        {
            string SavePath;

            if (this.PicturePath != null)
            {
                SavePath = System.IO.Path.GetDirectoryName(this.PicturePath) + "\\" + System.IO.Path.GetFileNameWithoutExtension(this.PicturePath);
            }
            else
            {
                SavePath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
                SavePath = System.IO.Path.GetDirectoryName(SavePath);
                SavePath = SavePath.Replace("file:\\", "");
            }

            this.pictureBox3.Image.Save(SavePath + "_nobg.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox5.Image.Save(SavePath + "_arcinletter.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox2.Image.Save(SavePath + "_noartifacts.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox4.Image.Save(SavePath + "_binarised.png", System.Drawing.Imaging.ImageFormat.Png);
            this.pictureBox7.Image.Save(SavePath + "_segmented.png", System.Drawing.Imaging.ImageFormat.Png);
        }
示例#4
0
 private static void InitSavePath()
 {
     if (App.Steam)
     {
         // Save to Steam user folder
         string savePath;
         CheckSteamworksResult("SteamUser.GetUserDataFolder", SteamUser.GetUserDataFolder(out savePath, 4096));
         SavePath = savePath;
     }
     else if (App.Debug)
     {
         // Save to Debug directory
         SavePath = "../Saves".Replace('/', Path.DirectorySeparatorChar);
     }
     else
     {
         // Save to SDL2 directory
         SavePath = SDL.SDL_GetPrefPath(App.Info.DeveloperName, App.Info.Title);
         App.CheckSDLResult("SDL_GetPrefPath", SavePath);
         SavePath = SavePath.Replace(App.Info.DeveloperName + Path.DirectorySeparatorChar, "");
         Directory.CreateDirectory(SavePath);
     }
 }
示例#5
0
        private void SavePreview()
        {
            Debug.Log("Saving preview for the GIF");
            RenderTexture oldRT = RenderTexture.active;

            RenderTexture[] frames = m_Frames.ToArray();
            RenderTexture.active = frames[(int)frames.Length / 2];

            Texture2D target = new Texture2D(m_Width, m_Height, TextureFormat.ARGB32, false);

            target.hideFlags  = HideFlags.HideAndDontSave;
            target.wrapMode   = TextureWrapMode.Clamp;
            target.filterMode = FilterMode.Bilinear;
            target.anisoLevel = 0;

            target.ReadPixels(new Rect(0, 0, m_Width, m_Height), 0, 0);
            target.Apply();

            RenderTexture.active = oldRT;

            byte[] bytes = target.EncodeToPNG();
            System.IO.File.WriteAllBytes(SavePath.Replace(".gif", ".png"), bytes);
            Flush(target);
        }