DI implementation started with registry class and filing class
This commit is contained in:
@ -1,13 +1,33 @@
|
||||
using System;
|
||||
using ImageHandlingLibrary.InterFaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace ImageHandlingLibrary
|
||||
{
|
||||
public class Filing
|
||||
public class Filing : IFiling
|
||||
{
|
||||
|
||||
public BitmapImage ConvertFromDrawImage(System.Drawing.Image _image)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
//System.Drawing.Image.FromFile(@"D:\CsharpDevelop\PictureHandlingProject\pictures\AgueroVillage.JPG").Save(ms, ImageFormat.Bmp);
|
||||
_image.Save(ms, ImageFormat.Bmp);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
var bitmapImage = new BitmapImage();
|
||||
bitmapImage.BeginInit();
|
||||
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
||||
bitmapImage.StreamSource = ms;
|
||||
bitmapImage.EndInit();
|
||||
|
||||
return bitmapImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user