mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Load spectrogram bitmaps without file lock
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@466 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
87b6e781b2
commit
48bd1e35b1
@ -4,6 +4,7 @@ using System.Drawing;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Nikse.SubtitleEdit.Logic;
|
using Nikse.SubtitleEdit.Logic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Nikse.SubtitleEdit.Controls
|
namespace Nikse.SubtitleEdit.Controls
|
||||||
{
|
{
|
||||||
@ -1091,11 +1092,15 @@ namespace Nikse.SubtitleEdit.Controls
|
|||||||
void LoadSpectrogramBitmapsAsync(object sender, System.ComponentModel.DoWorkEventArgs e)
|
void LoadSpectrogramBitmapsAsync(object sender, System.ComponentModel.DoWorkEventArgs e)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
string fileName = System.IO.Path.Combine(_spectrogramDirectory, count + ".gif");
|
||||||
while (System.IO.File.Exists(System.IO.Path.Combine(_spectrogramDirectory, count + ".gif")))
|
while (System.IO.File.Exists(System.IO.Path.Combine(_spectrogramDirectory, count + ".gif")))
|
||||||
{
|
{
|
||||||
Bitmap bmp = new Bitmap(System.IO.Path.Combine(_spectrogramDirectory, count + ".gif"));
|
using (var ms = new MemoryStream(File.ReadAllBytes(fileName)))
|
||||||
_spectrogramBitmaps.Add(bmp);
|
{
|
||||||
|
_spectrogramBitmaps.Add((Bitmap)Bitmap.FromStream(ms));
|
||||||
|
}
|
||||||
count++;
|
count++;
|
||||||
|
fileName = System.IO.Path.Combine(_spectrogramDirectory, count + ".gif");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user