-
Notifications
You must be signed in to change notification settings - Fork 0
/
PictureEdit.cs
83 lines (62 loc) · 2.38 KB
/
PictureEdit.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AstroPhoto.LibRaw;
namespace MyAstroPhotoLibrary
{
internal partial class PictureEdit : Form
{
RgbImage stackResult;
string filePath;
const int maxV = 255;
const int Kr = 255;
const int Kg = 135;
const int Kb = 205;
public PictureEdit( RgbImage _stackResult, int count, string _filePath )
{
InitializeComponent();
stackResult = _stackResult;
filePath = _filePath;
minRUpDown.Value = 0;
maxRUpDown.Value = ( 255 * 255 * count ) / Kr;
minGUpDown.Value = 0;
maxGUpDown.Value = ( 255 * 255 * count ) / Kg;
minBUpDown.Value = 0;
maxBUpDown.Value = ( 255 * 255 * count ) / Kb;
//stackResult.Divide( count );
//pictureBox.Image = stackResult.RenderBitmap();
}
private void render_Click( object sender, EventArgs e )
{
/*pictureBox.Image.Dispose();
stackResult.MinR = (int)minRUpDown.Value;
stackResult.MaxR = (int)maxRUpDown.Value;
stackResult.MinG = (int) minGUpDown.Value;
stackResult.MaxG = (int) maxGUpDown.Value;
stackResult.MinB = (int) minBUpDown.Value;
stackResult.MaxB = (int) maxBUpDown.Value;
pictureBox.Image = stackResult.Render();*/
}
private void save_Click( object sender, EventArgs e )
{
pictureBox.Image.Save( filePath, System.Drawing.Imaging.ImageFormat.Bmp );
}
private void autoLevelsButton_Click( object sender, EventArgs e )
{
/*stackResult.Autolevels(
double.Parse( lowTextBox.Text ), double.Parse( hiTextBox.Text ) );
minRUpDown.Value = stackResult.MinR;
maxRUpDown.Value = stackResult.MaxR;
minGUpDown.Value = stackResult.MinG;
maxGUpDown.Value = stackResult.MaxG;
minBUpDown.Value = stackResult.MinB;
maxBUpDown.Value = stackResult.MaxB;
pictureBox.Image = stackResult.Render();*/
}
}
}