Berichtworker angefangen
This commit is contained in:
@@ -84,6 +84,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bericht.cs" />
|
||||
<Compile Include="BerichtWorker.cs" />
|
||||
<Compile Include="FrmOptions.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
36
BerichtGen/BerichtWorker.cs
Normal file
36
BerichtGen/BerichtWorker.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BerichtGen
|
||||
{
|
||||
public class BerichtWorker
|
||||
{
|
||||
public static Image resizeImage(Image imgToResize, Size size)
|
||||
{
|
||||
int width = imgToResize.Width;
|
||||
int height = imgToResize.Height;
|
||||
float scale = 0f;
|
||||
float newWidth = 0f;
|
||||
float newHeight = 0f;
|
||||
|
||||
newWidth = (float)size.Width / (float)width;
|
||||
newHeight = (float)size.Height / (float)height;
|
||||
|
||||
scale = ((!(newHeight < newWidth)) ? newWidth : newHeight);
|
||||
int width2 = (int)((float)width * scale);
|
||||
int height2 = (int)((float)height * scale);
|
||||
|
||||
Bitmap bitmap = new Bitmap(width2, height2);
|
||||
Graphics graphics = Graphics.FromImage(bitmap);
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.DrawImage(imgToResize, 0, 0, width2, height2);
|
||||
graphics.Dispose();
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
SanShared/BerichtWorker.cs
Normal file
13
SanShared/BerichtWorker.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SanShared
|
||||
{
|
||||
public class BerichtWorker
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BerichtWorker.cs" />
|
||||
<Compile Include="BilderObject.cs" />
|
||||
<Compile Include="Exceptions\CSVImportException.cs" />
|
||||
<Compile Include="Exceptions\DataBaseVersionMismatchException.cs" />
|
||||
|
||||
@@ -127,6 +127,7 @@ namespace SanSystem
|
||||
return;
|
||||
}
|
||||
pt_box.Load(pfad);
|
||||
|
||||
pt_box.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user