コード例 #1
0
ファイル: HDRFrame.xaml.cs プロジェクト: vivkpatl/HDRNow
        //saves the image as a .png image
        private async void SavePNG(object sender, RoutedEventArgs e)
        {
            LDRImage HDRPreview = new LDRImage();
            await HDRPreview.LoadFromBytes(HDRI.Transform(), HDRI.Width, HDRI.Height);

            HDRPreview.SaveFile();
        }
コード例 #2
0
ファイル: HDRFrame.xaml.cs プロジェクト: vivkpatl/HDRNow
        //Called when the play button is pressed
        private async void Recalculate(object sender, TappedRoutedEventArgs e)
        {
            //Re-renders the HDR image based on the new slider value
            HDRI = Blending.Blend(sliderValue / 100f, underExp, regExp, overExp);

            //Creates and displays a preview LDR image based off of the HDR image
            HDRPreview = new LDRImage();
            await HDRPreview.LoadFromBytes(HDRI.Transform(), HDRI.Width, HDRI.Height);

            HDRImage.Source = HDRPreview.GetBitmapImage();

            RecalculateButton.IsEnabled = false;
        }
コード例 #3
0
ファイル: HDRFrame.xaml.cs プロジェクト: vivkpatl/HDRNow
        /// <summary>
        /// Shows a specified channel in the loaded <see cref="HDRI"/>
        /// </summary>
        /// <param name="channel">I think 0 is red?</param>
        private async void ShowChannel(int channel)
        {
            SaveButton.IsEnabled        = false;
            RecalculateButton.IsEnabled = false;
            BlenderSlider.IsEnabled     = false;

            if (HDRI == null)
            {
                return;
            }
            calculated = new LDRImage();
            await calculated.LoadFromBytes(HDRI.TransformChannel(channel), HDRI.Width, HDRI.Height);

            ShowCalculated();
        }