public void BinDingImag(string ImageName, Image image)
{
using (FileStream FS = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "Images//ManTitle//" + ImageName + ".png", FileMode.Open))
{
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(FS);
image.Source = ConverImages.GetImageBrushFrom_PResource(bmp).ImageSource;
image.Stretch = Stretch.Fill;
bmp.Dispose();
FS.Dispose();
FS.Close();
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Media;
ConverImages----类
public class ConverImages
{
///
/// 图片转换
///
///
///
public static ImageBru