private void ckOverwrite_CheckedChanged(object sender, EventArgs e) { // Not active if (!ckOverwrite.Enabled) { return; } // Reset all if (!ckOverwrite.Checked) { // Create helper PictureParameters current = m_Viewer.PictureParameters; // Back to the defaults SetBar(selSaturation, current.Saturation, m_Initial.Saturation.Default); SetBar(selBrightness, current.Brightness, m_Initial.Brightness.Default); SetBar(selContrast, current.Contrast, m_Initial.Contrast.Default); SetBar(selHue, current.Hue, m_Initial.Hue.Default); // Reset picture m_Viewer.PictureParameters = current; } // Disable all selBrightness.Enabled = ckOverwrite.Checked; selSaturation.Enabled = ckOverwrite.Checked; selContrast.Enabled = ckOverwrite.Checked; selHue.Enabled = ckOverwrite.Checked; }
private void SetBar(TrackBar bar, PictureParameters.ParameterSet parameter, PictureParameters parameters) { // Load the relative value double relVal = (bar.Value - bar.Minimum) * 1.0 / (bar.Maximum - bar.Minimum); // Copy to value parameter.Value = (float)(parameter.Minimum + relVal * (parameter.Maximum - parameter.Minimum)); // Change picture m_Viewer.PictureParameters = parameters; }
void IGeneralInfo.SetPictureParameters(PictureParameters parameters) { // Copy over if necessary if (Properties.Settings.Default.OverwriteVideoSettings) { // Set all SetVideoParameter(parameters.Brightness, Properties.Settings.Default.VideoBrightness); SetVideoParameter(parameters.Saturation, Properties.Settings.Default.VideoSaturation); SetVideoParameter(parameters.Hue, Properties.Settings.Default.VideoHue); SetVideoParameter(parameters.Contrast, Properties.Settings.Default.VideoContrast); } }
private void selHue_ValueChanged(object sender, EventArgs e) { // Not active if (!selHue.Enabled) { return; } // Load current parameters PictureParameters current = m_Viewer.PictureParameters; // Process SetBar(selHue, current.Hue, current); }
public ProgramSettings(IViewerSite viewer) { // Remember m_Viewer = viewer; // Load picture parameters if (null != m_Viewer) { m_Initial = m_Viewer.PictureParameters; } // Set up self InitializeComponent(); }
public async Task <IActionResult> GetAll([FromQuery] PictureParameters parameters) { var pictures = await this.Repository.GetAll(parameters); var pictureDtos = pictures.Select(p => this.Mapper.Map <PictureDto>(p)); this.Response.AddPaginationHeader(new PaginationHeader ( pictures.PageNumber, pictures.PageSize, pictures.TotalPages, pictures.TotalCount )); return(this.Ok(pictureDtos)); }
public async Task <ActionResult <IEnumerable <Picture> > > GetPictures([FromQuery] PictureParameters pictureParameters) { Pagination <Picture> pictures = await Pagination <Picture> .ToPagedListAsync(_context.Pictures.AsNoTracking().OrderBy(p => p.PictureId), pictureParameters.PageNumber, pictureParameters.PageSize); var metadata = new { pictures.TotalCount, pictures.PageSize, pictures.CurrentPage, pictures.TotalPages, pictures.HasNext, pictures.HasPrevious }; Response.Headers.Add("X-Pagination", JsonSerializer.Serialize(metadata)); return(pictures); }
public Picture(PictureParameters parameters) { Parameters = parameters; }
private void cmdSave_Click(object sender, EventArgs e) { // Validate if (!string.IsNullOrEmpty(txMCast.Text)) { try { // Parse var test = IPAddress.Parse(txMCast.Text); // Load byte first = test.GetAddressBytes()[0]; // Check if ((first < 224) || (first > 239)) { throw new Exception(); } } catch { // Report MessageBox.Show(Properties.Resources.BadMulticast); // Do not leave DialogResult = DialogResult.None; // Done return; } } // Attach to settngs var settings = Properties.Settings.Default; // Check for changes settings.SettingChanging += SettingChanging; try { // Copy general settings.DVBNETViewer_FullServer_VCR30Server = txURL.Text; settings.UseCyberlinkCodec = ckCyberlink.Checked; settings.UseRadio = (selType.SelectedIndex < 2); settings.BroadcastPort = (ushort)selPort.Value; settings.UseTV = (selType.SelectedIndex != 1); settings.FreeTV = (selEnc.SelectedIndex != 1); settings.PayTV = (selEnc.SelectedIndex < 2); settings.HideCursor = ckHideCursor.Checked; settings.OSDLifeTime = (int)selOSD.Value; settings.AVDelay = (int)udAVDelay.Value; settings.UseRemote = ckRemote.Checked; settings.Priority = CurrentPriority; settings.BroadcastIP = txMCast.Text; // Load decoders settings.MPEG2Decoder = ReadList(selMPEG2); settings.H264Decoder = ReadList(selH264); settings.MP2Decoder = ReadList(selMP2); settings.AC3Decoder = ReadList(selAC3); // Copy picture parameters if (ckOverwrite.Enabled) { // All parameters as is var current = m_Viewer.PictureParameters; // Copy settings.OverwriteVideoSettings = ckOverwrite.Checked; settings.VideoSaturation = current.Saturation.Value; settings.VideoBrightness = current.Brightness.Value; settings.VideoContrast = current.Contrast.Value; settings.VideoHue = current.Hue.Value; // Do not reset m_Initial = null; } } finally { // Remove handler settings.SettingChanging -= SettingChanging; } }