Ejemplo n.º 1
0
        public EditWidgetCurvePresets()
        {
            InitializeComponent();

            SuggestedPresetList.SelectedIndexChanged += (e, args) =>
            {
                PreviewBox.Refresh();
            };

            PreviewBox.Paint += (e, args) =>
            {
                if (SuggestedPresetList.Items.Count <= 0 || SuggestedPresetList.SelectedItems.Count <= 0)
                {
                    return;
                }

                var curve = SuggestedPresetList.SelectedItems[0].Tag as ResponseCurve;

                Point previousPoint = ConvertXYToPoint(0.0, curve.ComputeValue(0.0));

                for (double x = 0.0; x <= 1.0; x += 0.001)
                {
                    double y = curve.ComputeValue(x);
                    Point  p = ConvertXYToPoint(x, y);

                    args.Graphics.DrawLine(Pens.Blue, previousPoint, p);
                    previousPoint = p;
                }
            };

            PopulateSuggestions();
        }
Ejemplo n.º 2
0
 //用于分辨率切换时,刷新背景绘图
 private void timer2_Tick(object sender, EventArgs e)
 {
     //切换分辨率后,擦除一次背景
     if (m_bEraseBk == true)
     {
         m_bEraseBk = false;
         PreviewBox.Refresh();
     }
 }
Ejemplo n.º 3
0
 private void RotateButton_Click(object sender, EventArgs e)
 {
     if (Rotation == RotateFlipType.RotateNoneFlipNone)
     {
         Rotation = RotateFlipType.Rotate90FlipNone;
     }
     else if (Rotation == RotateFlipType.Rotate90FlipNone)
     {
         Rotation = RotateFlipType.Rotate180FlipNone;
     }
     else if (Rotation == RotateFlipType.Rotate180FlipNone)
     {
         Rotation = RotateFlipType.Rotate270FlipNone;
     }
     else if (Rotation == RotateFlipType.Rotate270FlipNone)
     {
         Rotation = RotateFlipType.RotateNoneFlipNone;
     }
     CurrentImage.RotateFlip(RotateFlipType.Rotate90FlipNone);
     PreviewBox.Refresh();
 }
Ejemplo n.º 4
0
 private void DimensionsInput_ValueChanged(object sender, EventArgs e)
 {
     ProportionPreview();
     PreviewBox.Refresh();
 }