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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,17 +31,21 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Filing.cs" />
|
||||
<Compile Include="InterFaces\IFiling.cs" />
|
||||
<Compile Include="InterFaces\IRegistring.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Registring.cs" />
|
||||
|
||||
15
ImageHandlingLibrary/InterFaces/IFiling.cs
Normal file
15
ImageHandlingLibrary/InterFaces/IFiling.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace ImageHandlingLibrary.InterFaces
|
||||
{
|
||||
public interface IFiling
|
||||
{
|
||||
BitmapImage ConvertFromDrawImage(Image _image);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user