mirror of https://github.com/PCSX2/pcsx2.git
GSDumpGUI: Add png image display support
This commit is contained in:
parent
97215008c9
commit
aa3f4c74dc
|
@ -293,19 +293,22 @@ namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
if (lstDumps.SelectedIndex != -1)
|
if (lstDumps.SelectedIndex != -1)
|
||||||
{
|
{
|
||||||
|
String [] Extensions = new String[] { ".png", ".bmp" };
|
||||||
String DumpFileName = lstDumps.SelectedItem.ToString().Split(new char[] { '|' })[0];
|
String DumpFileName = lstDumps.SelectedItem.ToString().Split(new char[] { '|' })[0];
|
||||||
String Filename = Path.GetDirectoryName(Properties.Settings.Default.DumpDir + "\\") +
|
String Filename = Path.GetDirectoryName(Properties.Settings.Default.DumpDir + "\\") +
|
||||||
"\\" + Path.GetFileNameWithoutExtension(DumpFileName) + ".bmp";
|
"\\" + Path.GetFileNameWithoutExtension(DumpFileName);
|
||||||
if (File.Exists(Filename))
|
|
||||||
|
foreach (String Extension in Extensions)
|
||||||
{
|
{
|
||||||
pctBox.Image = Image.FromFile(Filename);
|
if (File.Exists(Filename + Extension))
|
||||||
pctBox.Cursor = Cursors.Hand;
|
{
|
||||||
}
|
pctBox.Load(Filename + Extension);
|
||||||
else
|
pctBox.Cursor = Cursors.Hand;
|
||||||
{
|
return;
|
||||||
pctBox.Image = NoImage;
|
}
|
||||||
pctBox.Cursor = Cursors.Default;
|
|
||||||
}
|
}
|
||||||
|
pctBox.Image = NoImage;
|
||||||
|
pctBox.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,10 +316,7 @@ namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
if (pctBox.Cursor == Cursors.Hand)
|
if (pctBox.Cursor == Cursors.Hand)
|
||||||
{
|
{
|
||||||
String DumpFileName = lstDumps.SelectedItem.ToString().Split(new char[] { '|' })[0];
|
Process.Start(pctBox.ImageLocation);
|
||||||
String Filename = Path.GetDirectoryName(Properties.Settings.Default.DumpDir + "\\") +
|
|
||||||
"\\" + Path.GetFileNameWithoutExtension(DumpFileName) + ".bmp";
|
|
||||||
Process.Start(Filename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue