主界面左侧菜单相关

This commit is contained in:
cyf
2026-07-03 14:45:29 +08:00
parent aacefa24f8
commit 57ff1ea406
2 changed files with 20 additions and 11 deletions
+5 -11
View File
@@ -36,10 +36,9 @@ namespace Lskj.Util
{
if (bytes == null) return null;
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes))
using (System.Drawing.Image sourceImage = System.Drawing.Image.FromStream(ms))
{
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
ms.Flush();
return returnImage;
return new Bitmap(sourceImage);
}
}
catch (Exception)
@@ -56,14 +55,9 @@ namespace Lskj.Util
{
try
{
FileStream fs = File.OpenRead(path); //OpenRead
int filelength = 0;
filelength = (int)fs.Length; //获得文件长度
Byte[] image = new Byte[filelength]; //建立一个字节数组
fs.Read(image, 0, filelength); //按字节流读取
System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
fs.Close();
return result;
if (string.IsNullOrWhiteSpace(path) || !File.Exists(path)) return null;
byte[] image = File.ReadAllBytes(path);
return ReadImage(image);
}
catch (Exception)
{
+15
View File
@@ -203,6 +203,21 @@ namespace Lskj.Util
{
get { return BitMapPath + "Main/Module/"; }
}
/// <summary>
/// 主界面左侧树图标路径
/// </summary>
public static string MainTreeviewImagePath
{
get
{
string path = BitMapPath + "Main\\MainTreeview\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public static string MesItemImage
{
get { return BitMapPath + "MesItem/"; }