private void cmbFontAwesomeType_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (this.CmbFontAwesomeType.SelectedIndex < 0) { return; } FontAwesome.IconSize = (int)this.Slider1.Value; if (this.CmbBackColor.SelectedIndex > -1) { FontAwesome.BackColer = System.Drawing.Color.FromName(this.CmbBackColor.SelectedItem.ToString()); } if (this.CmbBorderColor.SelectedIndex > -1) { FontAwesome.BorderColer = System.Drawing.Color.FromName(this.CmbBorderColor.SelectedItem.ToString()); } if (this.CmbForeColor.SelectedIndex > -1) { FontAwesome.ForeColer = System.Drawing.Color.FromName(this.CmbForeColor.SelectedItem.ToString()); } FontAwesome.BorderVisible = this.CbShowBorder.IsChecked == true; int val = FontAwesome.TypeDict[this.CmbFontAwesomeType.SelectedItem.ToString()]; Bitmap bmp = FontAwesome.GetImage(val);//f188 ImageSource imgs = ToImageSource(bmp); this.Image.Background = new ImageBrush() { ImageSource = imgs, Stretch = Stretch.None }; }
private void menuXList1_DownClick(TPlayerList.TopItem Item) { thisPage = 1; isdownok = true; menuXList1.SelectItemIndex = Item.Index; menuXList1.Tom(Item); webVideoList1.Items.Clear(); webVideoList1.chatVScroll.MoveSliderToLocation(0); string typeUrl = $"?ac=detail&t={Item.Tag}&pg={thisPage}"; timer1.Enabled = true; Action _action = () => { LoadingCover(typeUrl); }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { this.Invoke(new Action(() => { webVideoList1.chatVScroll.OnScrollChange(100); timer1.Enabled = false; if (isgo != -1) { isgo = -1; //isgo = true; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } })); })); }
private void cmbFontAwesomeType_SelectedIndexChanged(object sender, EventArgs e) { if (this.cmbFontAwesomeType.SelectedIndex < 0) { return; } FontAwesome.IconSize = (int)this.nudIconSize.Value; if (this.cmbBackColor.SelectedIndex > -1) { FontAwesome.BackColer = Color.FromName(this.cmbBackColor.Text); } if (this.cmbBorderColor.SelectedIndex > -1) { FontAwesome.BorderColer = Color.FromName(this.cmbBorderColor.Text); } if (this.cmbForeColor.SelectedIndex > -1) { FontAwesome.ForeColer = Color.FromName(this.cmbForeColor.Text); } FontAwesome.BorderVisible = this.cbShowBorder.Checked == true; int val = FontAwesome.TypeDict[this.cmbFontAwesomeType.Text]; Bitmap bmp = FontAwesome.GetImage(val);//f188 this.panel1.BackgroundImage = bmp; this.Icon = FontAwesome.GetIcon(val);//f188; }
public Setting(TPlayer player, string index = "1") { this.player = player; InitializeComponent(); this._index = index; btn_refresh.Image = FontAwesome.GetImage("4FA6", 30, Color.Black); btn_min.Image = FontAwesome.GetImage("4FA9", 30, Color.Black); btn_close.Image = FontAwesome.GetImage("4FA3", 30, Color.Black); btn_close.ImageHove = FontAwesome.GetImage("4FA3", 30, Color.White); }
public WebZimu(TPlayer player, string txt) { this.player = player; InitializeComponent(); btn_close.Image = FontAwesome.GetImage("4FA3", 30, Color.Black); btn_close.ImageHove = FontAwesome.GetImage("4FA3", 30, Color.White); text_search.Text = txt; frmSearch1.CueBannerText = text_search.CueBannerText; }
void _LoadType() { timer1.Enabled = true; string key = dataClass.baseType + "Title"; menuXList1.Items.Clear(); Action _action = () => { List <TitleName> titleNames; if (config.Exists(key)) { titleNames = JsonConvert.DeserializeObject <List <TitleName> >(config.GetPicCacheData(key)); } else { titleNames = dataClass.GetVideoType(); config.AddPicCacheData(key, JsonConvert.SerializeObject(titleNames)); } foreach (TitleName item in titleNames) { menuXList1.Items.Add(new TPlayerList.TopItem { Enabled = true, Visible = true, Tag = item.titleId, Name = item.titleType, }); } }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { this.Invoke(new Action(() => { menuXList1.InPaint(); menuXList1.Invalidate(); if (menuXList1.Items.Count > 0) { menuXList1_DownClick(menuXList1.Items[0]); } else { timer1.Enabled = false; if (isgo != -1) { isgo = -1; //isgo = true; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } } })); })); }
public WebBrowser(TPlayer player) { this.player = player; InitializeComponent(); btn_min.Image = FontAwesome.GetImage("4FA9", 30, Color.Black); btn_max.Image = FontAwesome.GetImage("4FB2", 30, Color.Black); btn_close.Image = FontAwesome.GetImage("4FA3", 30, Color.Black); btn_close.ImageHove = FontAwesome.GetImage("4FA3", 30, Color.White); btn_list.Image = FontAwesome.GetImage("4F8F", 30, Color.Black); btn_next.Image = FontAwesome.GetImage("50D9", 18, Color.Black); }
public WebVideoDetail(WebVideo webVideo, Video video, string videotype) { this.webVideo = webVideo; this.video = video; this.videotype = videotype; SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.Selectable | ControlStyles.DoubleBuffer, true); //强制分配样式重新应用到控件上 UpdateStyles(); InitializeComponent(); btn_close.Image = FontAwesome.GetImage("4FA4", 30, Color.Black); if (video.videoImg != null) { Rectangle Rect = new Rectangle(0, 0, video.videoImg.Width, video.videoImg.Height); Bitmap bitmap = new Bitmap(video.videoImg); using (Graphics gTop = Graphics.FromImage(bitmap)) { gTop.FillRectangle(new SolidBrush(Color.FromArgb(200, 255, 255, 255)), Rect); } bitmap.GaussianBlur(ref Rect, 80, false); this.BackgroundImage = bitmap; } pictureBox1.Image = video.videoImg; label1.Text = video.videoName; label3.Text = video.videoQuality; foreach (VideoInfo item in video.videoTotalInfo) { Label label = new Label { BackColor = Color.Transparent, Text = item.key + ":" + item.value + " ", AutoSize = true }; panel1.Controls.Add(label); label.MouseDown += Frn_Move; } foreach (PlayAddress item in video.playInformation) { menuXList1.Items.Add(new TPlayerList.TopItem { Visible = true, Enabled = true, Name = item.playType }); } menuXList1.InPaint(); menuXList1.Invalidate(); label4.Text = video.videoSynopsis; }
public Sidebar(TPlayer player) { this.player = player; SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true); UpdateStyles(); InitializeComponent(); btn_search.Image = FontAwesome.GetImage("5128", 26, Color.White); }
public bool isMax = false;//记录是否最大化 /// <summary> /// 最大化还原 /// </summary> public void Max() { if (WindowState == FormWindowState.Maximized) { btn_max.Image = FontAwesome.GetImage("4FB2", 30, Color.Black); WindowState = FormWindowState.Normal; } else { btn_max.Image = FontAwesome.GetImage("4FB1", 30, Color.Black); WindowState = FormWindowState.Maximized; } }
public WebVideo(TPlayer player) { this.player = player; InitializeComponent(); pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); btn_min.Image = FontAwesome.GetImage("4FA9", 30, Color.Black); btn_max.Image = FontAwesome.GetImage("4FB2", 30, Color.Black); btn_close.Image = FontAwesome.GetImage("4FA3", 30, Color.Black); btn_close.ImageHove = FontAwesome.GetImage("4FA3", 30, Color.White); webVideoList1.chatVScroll.ScrollChange += (value) => { //System.Diagnostics.Debug.WriteLine("当前:" + value); if (isdownok && !isrun && value > 0.88) { isrun = true; thisPage++; int page = thisPage; Action _action = () => { if (Regex.IsMatch(thisURL, @"pg-([\d])")) { string result = Regex.Replace(thisURL, @"pg-([\d]*)", "pg-" + thisPage); if (!LoadingCover(result, false)) { isdownok = false; } } }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { webVideoList1.Invoke(new Action(() => { webVideoList1.Invalidate(); })); isrun = false; })); } }; webVideoList1.TopChange += (bmp) => { panel1.BackgroundImage = bmp; }; //菜单 4FA1 }
private void text_search_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { e.Handled = true; string str = text_search.Text.Trim(); if (!string.IsNullOrEmpty(str)) { isdownok = true; webVideoList1.Items.Clear(); webVideoList1.chatVScroll.MoveSliderToLocation(0); isrun = timer1.Enabled = true; string strUrl = "index.php?m=vod-search-pg-1-wd-" + Uri.EscapeUriString(str) + ".html"; Action _action = () => { if (LoadingCover(strUrl)) { thisPage = 1; //txt_PageIndex.Text = thisPage.ToString(); } }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { webVideoList1.Invoke(new Action(() => { webVideoList1.Invalidate(); })); this.Invoke(new Action(() => { timer1.Enabled = false; if (isgo != -1) { isgo = -1; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } })); isrun = false; })); } } }
private void timer1_Tick(object sender, EventArgs e) { isgo++; Color color = Color.Black; switch (isgo) { case 0: color = Color.FromArgb(255, 63, 63); //红 break; case 1: color = Color.FromArgb(255, 189, 63); //橙 break; case 2: color = Color.FromArgb(255, 248, 63); //黄 break; case 3: color = Color.FromArgb(96, 255, 63); //绿 break; case 4: color = Color.FromArgb(63, 161, 255); //青 break; case 5: color = Color.FromArgb(51, 153, 204); //蓝 break; case 6: color = Color.FromArgb(204, 204, 255); //紫 break; default: isgo = -1; break; } pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, color); }
private void menuXList1_DownClick(TPlayerList.TopItem Item) { thisPage = 1; isdownok = true; menuXList1.SelectItemIndex = Item.Index; menuXList1.Tom(Item); webVideoList1.Items.Clear(); webVideoList1.chatVScroll.MoveSliderToLocation(0); string typeUrl; typeUrl = "?m=vod-index-pg-1.html"; if (!string.IsNullOrWhiteSpace(Item.Tag.ToString())) { typeUrl = $"?m=vod-type-id-{Item.Tag}-pg-" + thisPage + ".html"; } isrun = timer1.Enabled = true; Action _action = () => { LoadingCover(typeUrl); }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { isrun = false; this.Invoke(new Action(() => { webVideoList1.chatVScroll.OnScrollChange(100); timer1.Enabled = false; if (isgo != -1) { isgo = -1; //isgo = true; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } })); })); }
private void webVideoList1_DownClick(TPlayerList.WebVideoListItem Item) { Video video = Item.Tag as Video; if (video.playInformation != null) { if (timer1.Enabled) { timer1.Enabled = false; if (isgo != -1) { isgo = -1; //isgo = true; pictureBox2.Image = FontAwesome.GetImage(fontlogo, "4FBB", 38, Color.Black); } } if (webVideoDetail != null) { webVideoDetail.Close(); } webVideoDetail = new WebVideoDetail(this, video, dataClass.baseType); webVideoDetail.Show(this); } else if (video.isRun) { Api.OpenMessage(this, MessageType.Info, "请稍后,正在获取地址"); } else { timer1.Enabled = true; video.isRun = true; bool isOk = false; Action _action = () => { Video vs = dataClass.GetVideoInfo(video.id); int errCount = 0; while (vs == null) { System.Threading.Thread.Sleep(500); vs = dataClass.GetVideoInfo(video.id); errCount++; if (errCount > 5) { break; } } if (vs != null) { isOk = true; video.videoName = vs.videoName; video.videoImgUrl = vs.videoImgUrl; video.videoType = vs.videoType; video.videoQuality = vs.videoQuality; video.videoTotalInfo = vs.videoTotalInfo; video.videoSynopsis = vs.videoSynopsis; video.playInformation = vs.playInformation; if (Item.Img == null) { HttpLib.WebResult webResult; byte[] data = HttpLib.Http.Get(vs.videoImgUrl).redirect(true).requestData(out webResult); if (webResult != null) { video.videoImg = Item.Img = data.ToImage(); PicCacheData picdata = new PicCacheData { pictureID = video.id, pictureImage = data, picType = dataClass.baseType, };//保存封面缩略图 picCacheDataDAL.InsertPicUrl(picdata); } } } }; _task.ContinueWhenAll(new Task[] { _task.StartNew(_action) }, (action => { if (isOk) { this.BeginInvoke(new Action(() => { webVideoList1_DownClick(Item); })); } else { Api.OpenMessage(this, MessageType.Warn, "地址获取失败!"); } video.isRun = false; })); } }
protected override void OnLoad(EventArgs e) { playList.PlayIndex = player.PlayIndex; playList.Playing = player.IsPlayPause; Player_LocationSizeChanged(this, e); videoList(); base.OnLoad(e); player.LocationChanged += Player_LocationSizeChanged; player.SizeChanged += Player_LocationSizeChanged; btn_del.Image = FontAwesome.GetImage("4F8C", 38); btn_more.Image = FontAwesome.GetImage("4F88", 38); bool isDownDel = false, isDownMore = false; #region 功能菜单 btn_more.MouseDown += (a, b) => { isDownMore = true; if (player.isTvModel) { Action _action = () => { System.Threading.Thread.Sleep(600); }; player._task.ContinueWhenAll(new Task[] { player._task.StartNew(_action) }, (action => { if (isDownMore) { isDownMore = false; Frm.UIListSel frm = new Frm.UIListSel(player.CountrysTemp, SystemSettings.TvSourceType); if (frm.ShowDialog() == DialogResult.OK) { try { SystemSettings.TvSourceType = frm.SelValue; List <Frm.TvData> Channel = player.tvDatas.FindAll(ab => ab.country.name == SystemSettings.TvSourceType); List <PlayerItem> PlayList_Temp = new List <PlayerItem>(); foreach (Frm.TvData item in Channel) { PlayList_Temp.Add(new PlayerItem("web", item.url, item.name)); } player.PlayIndex = -1; player.SetPlayList(PlayList_Temp); } catch (Exception ez) { Api.OpenMessage(player, Frm.MessageType.Error, "切换失败:" + ez.Message); } } this.Invoke(new Action(() => { playList.Invalidate(); })); } })); } }; btn_more.MouseUp += (a, b) => { if (isDownMore) { isDownMore = false; btn_del.Visible = playList.IsCheck = !playList.IsCheck; } }; btn_more.Leave += (a, b) => { isDownMore = false; }; #endregion #region 除 btn_del.MouseDown += (a, b) => { isDownDel = true; Action _action = () => { System.Threading.Thread.Sleep(600); }; player._task.ContinueWhenAll(new Task[] { player._task.StartNew(_action) }, (action => { if (isDownDel) { isDownDel = false; foreach (var item in playList.Items) { if (item.Visible) { item.Check = !item.Check; if (item.Check) { DelTemp.Add(item); } else { DelTemp.Remove(item); } } } this.Invoke(new Action(() => { playList.Invalidate(); })); } })); }; btn_del.MouseUp += (a, b) => { if (isDownDel) { isDownDel = false; btn_del.Visible = playList.IsCheck = false; if (DelTemp.Count > 0) { bool isStop = false; List <PlayerItem> PlayListTemp = new List <PlayerItem>(); foreach (TPlayerList.VideoListItem item in DelTemp) { if (player.PlayIndex == item.Index) { isStop = true; } PlayListTemp.Add(player.PlayList[item.Index]); } player.PlayList.RemoveAll(ab => PlayListTemp.Contains(ab)); DelTemp.Clear(); if (isStop && player.IsPlaying) { if (player.PlayList.Count == 0) { player.player.Close(); } else { player.PlayUp(); } } else { if (player.PlayIndex > player.PlayList.Count - 1) { player.PlayIndex--; } } //playList.chatVScroll.Value = 0; videoList(); } } }; btn_del.Leave += (a, b) => { isDownDel = false; }; #endregion text_search.GotFocus += (a, b) => { text_search.BackColor = panel1.BackColor = btn_search.BorderColor = Color.FromArgb(64, 64, 73); }; text_search.LostFocus += (a, b) => { text_search.BackColor = panel1.BackColor = btn_search.BorderColor = this.BackColor; }; if (SystemSettings.Animation) { if (player.IsFullScreen || player.isMax) { Rectangle WorkingAreaRect = Screen.PrimaryScreen.WorkingArea; new ControlAnimation().LeftMove(player._sidebarBtn, (WorkingAreaRect.Left + player.ClientRectangle.Width - player._sidebarBtn.Width) - this.Width, 100, AnimationType.Ball); AnimateWindow(this.Handle, 80, 0x00040000 | 0x00000002 | 0x20000); } else { AnimateWindow(this.Handle, 80, 0x00040000 | 0x00000001 | 0x20000); } } else if (player.IsFullScreen || player.isMax) { Rectangle WorkingAreaRect = Screen.PrimaryScreen.WorkingArea; player._sidebarBtn.Left = (WorkingAreaRect.Left + player.ClientRectangle.Width - player._sidebarBtn.Width) - this.Width; } OnSizeChanged(null); }