1
|
using System.Drawing;
|
2
|
using System.Drawing.Imaging;
|
3
|
|
4
|
namespace TextureEditing
|
5
|
{
|
6
|
/// <summary>
|
7
|
/// Output png carrier
|
8
|
/// </summary>
|
9
|
class PngEdited
|
10
|
{
|
11
|
/// <summary> Name of png </summary>
|
12
|
public string name;
|
13
|
|
14
|
/// <summary> Image </summary>
|
15
|
public Bitmap png;
|
16
|
|
17
|
/// <summary> Coordinates of max and min x in original image </summary>
|
18
|
public int xStart, xEnd;
|
19
|
/// <summary> Coordinates of max and min y in original image </summary>
|
20
|
public int yStart, yEnd;
|
21
|
|
22
|
/// <summary> Coordinates of bottom left corner in % from bottom left corner of original </summary>
|
23
|
public float xPerc, yPerc;
|
24
|
/// <summary> Coordinates of centroid in % from bottom left corner of cropped image </summary>
|
25
|
public float xCentr, yCentr;
|
26
|
|
27
|
/// <summary>
|
28
|
/// Save as png file
|
29
|
/// </summary>
|
30
|
/// <param name="outPath">Path to output file</param>
|
31
|
internal void Save(string outPath)
|
32
|
{
|
33
|
png.Save(outPath, ImageFormat.Png);
|
34
|
}
|
35
|
}
|
36
|
}
|