private void diemPhat_MM(object sender, MouseEventArgs e) { if (mouseUp) { var mousePos = panel_duongRay.PointToClient(Cursor.Position).X; if (mousePos - panel_diemDangPhat.Width / 2 < 0) { panel_diemDangPhat.Location = new Point(0); return; } if (mousePos + panel_diemDangPhat.Width / 2 > panel_duongRay.Width) { panel_diemDangPhat.Location = new Point(panel_duongRay.Width - panel_diemDangPhat.Width); return; } panel_diemDangPhat.Location = new Point(mousePos - panel_diemDangPhat.Width / 2); var phanTramThanhCuon = (double)panel_diemDangPhat.Location.X / (double)(_doDaiTruotCuaDuongRay) * 100; cuonVideoHandle truotThanhCuon = thanhCuonDangTruot; var arg = new cuonVideoArgs() { phanTramThanhCuon = phanTramThanhCuon, }; truotThanhCuon(this, arg); } }
private void thayDoiGiaTriAmThanh(object sender, cuonVideoArgs e) { ucChoiVideo.Audio.Volume = (int)e.phanTramThanhCuon; if ((int)e.phanTramThanhCuon <= 5) { btn_loa.Values.Image = VideoEditor.Properties.Resources.speaker_mute; } else { btn_loa.Values.Image = VideoEditor.Properties.Resources.speaker; } }
private void ucMouseClick(object sender, MouseEventArgs e) { panel_redPoint.Location = new Point(e.X - panel_redPoint.Width / 2); panel_daQua.Size = new Size(panel_redPoint.Location.X, panel_duongRay.Height); var phanTramThanhCuon = (double)panel_redPoint.Location.X / (double)(bienDoTruot) * 100; var arg = new cuonVideoArgs() { phanTramThanhCuon = phanTramThanhCuon, }; if (thanhCuonDangTruot != null) { thanhCuonDangTruot(this, arg); } }
private void thanhTruotDangCuon(object sender, cuonVideoArgs e) { if (thongTinVideo == null) { return; } try { var thoiGianTuongUng = thongTinVideo.Duration.TotalMilliseconds * e.phanTramThanhCuon / 100; ucChoiVideo.thoiGianDangPhat = (int)thoiGianTuongUng; lb_DangPhat.Text = mainForm.TimeSpanToString(mainForm.SecondToTimespan(thoiGianTuongUng / 1000)); } catch { return; } }
private void diemPhat_MU(object sender, MouseEventArgs e) { mouseHold = false; var nutCuonArg = new NutCuonDuocNhanArgs() { duocNhanXuong = false, }; if (nhanNhaNutCuon != null) { nhanNhaNutCuon(this, nutCuonArg); } var phanTramThanhCuon = (double)panel_redPoint.Location.X / (double)(bienDoTruot) * 100; var arg = new cuonVideoArgs() { phanTramThanhCuon = phanTramThanhCuon, }; if (thanhCuonDangTruot != null) { thanhCuonDangTruot(this, arg); } }
private void thayDoiAmThanh(object sender, cuonVideoArgs e) { }