コード例 #1
0
        /// <summary>
        /// Adds a screenshot to the user's screenshot library. The screenshot image and thumbnail must already exist on the UFS.
        /// Results are returned in a <see cref="ScreenshotAddedCallback"/>.
        /// The returned <see cref="AsyncJob{T}"/> can also be awaited to retrieve the callback result.
        /// </summary>
        /// <param name="details">The details of the screenshot.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="ScreenshotAddedCallback"/>.</returns>
        public AsyncJob <ScreenshotAddedCallback> AddScreenshot(ScreenshotDetails details)
        {
            if (details == null)
            {
                throw new ArgumentNullException(nameof(details));
            }

            var msg = new ClientMsgProtobuf <CMsgClientUCMAddScreenshot>(EMsg.ClientUCMAddScreenshot);

            msg.SourceJobID = Client.GetNextJobID();

            if (details.GameID != null)
            {
                msg.Body.appid = details.GameID.AppID;
            }

            msg.Body.caption         = details.Caption;
            msg.Body.filename        = details.UFSImageFilePath;
            msg.Body.permissions     = ( uint )details.Privacy;
            msg.Body.thumbname       = details.UFSThumbnailFilePath;
            msg.Body.width           = details.Width;
            msg.Body.height          = details.Height;
            msg.Body.rtime32_created = ( uint )DateUtils.DateTimeToUnixTime(details.CreationTime);
            msg.Body.spoiler_tag     = details.ContainsSpoilers;

            Client.Send(msg);

            return(new AsyncJob <ScreenshotAddedCallback>(this.Client, msg.SourceJobID));
        }
コード例 #2
0
        /// <summary>
        /// Adds a screenshot to the user's screenshot library. The screenshot image and thumbnail must already exist on the UFS.
        /// Results are returned in a <see cref="ScreenshotAddedCallback"/>.
        /// </summary>
        /// <param name="details">The details of the screenshot.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="ScreenshotAddedCallback"/>.</returns>
        public JobID AddScreenshot(ScreenshotDetails details)
        {
            var msg = new ClientMsgProtobuf <CMsgClientUCMAddScreenshot>(EMsg.ClientUCMAddScreenshot);

            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.appid           = details.GameID.AppID;
            msg.Body.caption         = details.Caption;
            msg.Body.filename        = details.UFSImageFilePath;
            msg.Body.permissions     = ( uint )details.Privacy;
            msg.Body.thumbname       = details.UFSThumbnailFilePath;
            msg.Body.width           = details.Width;
            msg.Body.height          = details.Height;
            msg.Body.rtime32_created = ( uint )DateUtils.DateTimeToUnixTime(details.CreationTime);
            msg.Body.spoiler_tag     = details.ContainsSpoilers;

            Client.Send(msg);

            return(msg.SourceJobID);
        }
コード例 #3
0
        private void ShowImagePreviewer(Actions action, string imagePath)
        {
            Invoke((MethodInvoker) delegate
            {
                ScreenshotDetails details = new ScreenshotDetails(CurrentBrowser.URL);
                DialogResult dialogRes;
                string fileName;
                string dateAndtime;

                using (Previewer previewForm = new ImagePreviewer(action, CurrentBrowser.URL, imagePath))
                {
                    dialogRes   = previewForm.ShowDialog();
                    fileName    = previewForm.FileName + previewForm.FileExtension;
                    dateAndtime = previewForm.DateAndTime;
                }
                ImageDiskCache.RemoveItemsInCache();
                if (dialogRes != DialogResult.OK)
                {
                    return;
                }

                DisplaySavedLabel(fileName, dateAndtime);
            });
        }
コード例 #4
0
        /// <summary>
        /// Adds a screenshot to the user's screenshot library. The screenshot image and thumbnail must already exist on the UFS.
        /// Results are returned in a <see cref="ScreenshotAddedCallback"/> from a <see cref="SteamClient.JobCallback&lt;T&gt;"/>.
        /// </summary>
        /// <param name="details">The details of the screenshot.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback&lt;T&gt;"/>.</returns>
        public JobID AddScreenshot( ScreenshotDetails details )
        {
            var msg = new ClientMsgProtobuf<CMsgClientUCMAddScreenshot>( EMsg.ClientUCMAddScreenshot );
            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.appid = details.GameID.AppID;
            msg.Body.caption = details.Caption;
            msg.Body.filename = details.UFSImageFilePath;
            msg.Body.permissions = ( uint )details.Privacy;
            msg.Body.thumbname = details.UFSThumbnailFilePath;
            msg.Body.width = details.Width;
            msg.Body.height = details.Height;
            msg.Body.rtime32_created = Utils.DateTimeToUnixTime( details.CreationTime );
            msg.Body.spoiler_tag = details.ContainsSpoilers;

            Client.Send( msg );

            return msg.SourceJobID;
        }
コード例 #5
0
        public static void SendImage(string deviceId, string imageBas64)
        {
            try
            {
                Service1Client    d         = new Service1Client();
                ScreenshotDetails screenObj = new ScreenshotDetails();
                int length = !string.IsNullOrEmpty(imageBas64) ? imageBas64.Length : 0;

                screenObj.createdDate = System.DateTime.Now;
                screenObj.fk_DeviceId = deviceId;
                screenObj.isDeleted   = false;

                if (length > 20000)
                {
                    screenObj.screenshot1 = imageBas64.Substring(0, 20000);
                }
                if (length < 20000)
                {
                    screenObj.screenshot1 = imageBas64.Substring(0, length);
                }

                if (length < 40000 && length > 20000)
                {
                    screenObj.screenshot2 = imageBas64.Substring(20000, (length - 20000));
                }

                if (length > 40000)
                {
                    screenObj.screenshot2 = imageBas64.Substring(20000, 20000);
                }

                if (length > 40000 && length < 60000)
                {
                    screenObj.screenshot3 = imageBas64.Substring(40000, (length - 40000));
                }

                if (length > 60000)
                {
                    screenObj.screenshot3 = imageBas64.Substring(40000, 20000);
                }
                //save half string

                screenObj.id = d.SaveImageObj(screenObj);

                if (length > 60000 && length < 80000)
                {
                    screenObj.screenshot4 = imageBas64.Substring(60000, (length - 60000));
                }

                if (length > 80000)
                {
                    screenObj.screenshot4 = imageBas64.Substring(60000, 20000);
                }
                if (length > 100000)
                {
                    screenObj.screenshot5 = imageBas64.Substring(80000, (length - 80000));
                }
                if (length > 60000)
                {
                    screenObj.screenshot1 = "";
                    screenObj.screenshot2 = "";
                    screenObj.screenshot3 = "";
                    d.UpdateImageObj(screenObj);
                }
            }
            catch (Exception)
            {
            }
        }