public void LoadImage(string imageUri, bool InResources = true, Abstractions.Scaling Scaling = Scaling.Absolute_None) { var args = new SetImageHandler() { Path = imageUri, InResources = InResources, Scaling = Scaling }; SetImagePathEvent?.Invoke(this, args); }
public static void SetImage(PictureBox box, Image img) { if (box.InvokeRequired) { SetImageHandler handler = new SetImageHandler(SetImage); box.Invoke(handler, new object[] { box, img }); } else { box.Image = img; } }
void clsDownload_VideoInfoReceived(clsMain.VideoInfoEventArgs VideoInfo) { SetTextHandler sth = new SetTextHandler(SetText); strCurrentVideoTitle = VideoInfo.strTitle; object[] text = { txtInfo, "[AUTHOR YOUTUBE CHANNEL:]" + Environment.NewLine + VideoInfo.strAuthor + Environment.NewLine + Environment.NewLine + "[VIDEO VIEWS:]" + Environment.NewLine + VideoInfo.strViews + Environment.NewLine + Environment.NewLine + "[LIKES:]" + Environment.NewLine + VideoInfo.strLikes + Environment.NewLine + Environment.NewLine + "[DISLIKES:]" + Environment.NewLine + VideoInfo.strDislikes + Environment.NewLine + Environment.NewLine + "[VIDEO DURATION:]" + Environment.NewLine + VideoInfo.strLength }; txtInfo.Invoke(sth, text); SetImageHandler si = new SetImageHandler(SetImage); //object[] objLoading = { picVideoPic,Properties.Resources.Loading }; //picVideoPic.Invoke(si, objLoading); object[] objImage = { picVideoPic, VideoInfo.strPic }; picVideoPic.Invoke(si, objImage); SetControlPos scp = new SetControlPos(SetConPos); object[] objScroll = { lblScroll, pnlScroll.Left }; lblScroll.Invoke(scp, objScroll); object[] strTitle = { lblScroll, VideoInfo.strTitle }; lblScroll.Invoke(sth, strTitle); }