private void Button_Click(object sender, RoutedEventArgs e)
{
string filename = "FiveRes.dll";
var hDll = NativeLibrary.Load(filename);
if (hDll != IntPtr.Zero)
{
IntPtr hRes = LoadBitmap(hDll, 2063);
Bitmap bmp = Bitmap.FromHbitmap(hRes);
MemoryStream stream = new MemoryStream();
bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
image.Source = (new ImageSourceConverter()).ConvertFrom(stream) as ImageSource;
image.Width = bmp.Width;
image.Height = bmp.Height;
NativeLibrary.Free(hDll);
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)