当前位置: 首页>>代码示例>>C#>>正文


C# ImageSize.ToString方法代码示例

本文整理汇总了C#中ImageSize.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ImageSize.ToString方法的具体用法?C# ImageSize.ToString怎么用?C# ImageSize.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageSize的用法示例。


在下文中一共展示了ImageSize.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SearchGalleryAdvancedRequest

        /// <exception cref="ArgumentNullException">
        ///     Thrown when a null reference is passed to a method that does not accept it as a
        ///     valid argument.
        /// </exception>
        internal string SearchGalleryAdvancedRequest(string url,
            string qAll = null, string qAny = null,
            string qExactly = null, string qNot = null,
            ImageFileType? fileType = null, ImageSize? imageSize = null)
        {
            if (string.IsNullOrWhiteSpace(url))
                throw new ArgumentNullException(nameof(url));

            if (string.IsNullOrWhiteSpace(qAll) &&
                string.IsNullOrWhiteSpace(qAny) &&
                string.IsNullOrWhiteSpace(qExactly) &&
                string.IsNullOrWhiteSpace(qNot))
                throw new ArgumentNullException(null,
                    "At least one search parameter must be provided (All | Any | Exactly | Not).");

            var query = new StringBuilder();

            if (!string.IsNullOrWhiteSpace(qAll))
                query.Append($"&q_all={WebUtility.UrlEncode(qAll)}");

            if (!string.IsNullOrWhiteSpace(qAny))
                query.Append($"&q_any={WebUtility.UrlEncode(qAny)}");

            if (!string.IsNullOrWhiteSpace(qExactly))
                query.Append($"&q_exactly={WebUtility.UrlEncode(qExactly)}");

            if (!string.IsNullOrWhiteSpace(qNot))
                query.Append($"&q_not={WebUtility.UrlEncode(qNot)}");

            if (fileType != null)
                query.Append($"&q_type={WebUtility.UrlEncode(fileType.ToString().ToLower())}");

            if (imageSize != null)
                query.Append($"&q_size_px={WebUtility.UrlEncode(imageSize.ToString().ToLower())}");

            return $"{url}?{query}".Replace("?&", "?");
        }
开发者ID:DamienDennehy,项目名称:Imgur.API,代码行数:41,代码来源:GalleryRequestBuilder.cs

示例2: GetArtistArt

        public static string GetArtistArt(string baseUrl, ImageSize size, string apiKey, string artist)
        {
            //artist = GetArtistCorrection(baseUrl, apiKey, artist);
              Dictionary<string, string> parameters = new Dictionary<string, string>();
              parameters["method"] = "artist.getInfo";
              parameters["api_key"] = apiKey;
              parameters["artist"] = artist;

              XmlDocument xml = GetResponse(GetUrl(baseUrl, parameters));
              if (xml != null) {
            XmlNodeList xnList = xml.SelectNodes("/lfm/artist/image");
            foreach (XmlNode xn in xnList) {
              if (xn.Attributes["size"].Value == size.ToString())
            return xn.InnerText;
            }
              }
              return string.Empty;
        }
开发者ID:eisnerd,项目名称:muper,代码行数:18,代码来源:Scrobbler.cs

示例3: AssertUserProfileImage

	    // test helpers

	    private void AssertUserProfileImage(ImageSize imageSize)
        {
		    HttpHeaders responseHeaders = new HttpHeaders();
		    responseHeaders.ContentType = MediaType.IMAGE_PNG;
		    mockServer.ExpectNewRequest()
                .AndExpectUri("https://api.twitter.com/1/users/profile_image/brbaia?size=" + imageSize.ToString().ToLowerInvariant())
			    .AndExpectMethod(HttpMethod.GET)
			    .AndRespondWith(new AssemblyResource("assembly://Spring.Social.Twitter.Tests/Spring.Social.Twitter.Api.Impl/Logo.png"), responseHeaders);

#if NET_4_0 || SILVERLIGHT_5
		    twitter.UserOperations.GetUserProfileImageAsync("brbaia", imageSize).Wait();
#else
            twitter.UserOperations.GetUserProfileImage("brbaia", imageSize);
#endif
		    // TODO: Fix ResponseCreators to handle binary data so that we can assert the contents/size of the image bytes. 
	    }
开发者ID:erijss,项目名称:spring-net-social-twitter,代码行数:18,代码来源:UserTemplateTests.cs

示例4: GetUserProfileImageAsync

 public Task<byte[]> GetUserProfileImageAsync(string screenName, ImageSize size) 
 {
     return this.restTemplate.GetForObjectAsync<byte[]>(
         "users/profile_image/{screenName}?size={size}", screenName, size.ToString().ToLowerInvariant());
 }
开发者ID:erijss,项目名称:spring-net-social-twitter,代码行数:5,代码来源:UserTemplate.cs

示例5: SetImageSize

		/// <summary>
		/// Sets the image size. Camera must be reset afterwards.
		/// </summary>
		public void SetImageSize (ImageSize ImageSize)
		{
			this.EmptyBuffers ();

			if (this.uart.OutputToConsole)
				Console.Out.WriteLine ("SetImageSize(" + ImageSize.ToString () + ")");

			this.uart.Transmit (0x56, 0x00, 0x31, 0x05, 0x04, 0x01, 0x00, 0x19, (byte)ImageSize);
			this.uart.ReceiveAndVerify (0x76, 0x00, 0x31, 0x00, 0x00);
		}
开发者ID:mukira,项目名称:Learning-IoT-HTTP,代码行数:13,代码来源:LinkSpriteJpegColorCamera.cs

示例6: ConvertToImageSizeName

 private ImageSizeName ConvertToImageSizeName(ImageSize size)
 {
     switch (size)
     {
         case PostHtmlEditing.ImageSize.Small:
             return ImageSizeName.Small;
         case PostHtmlEditing.ImageSize.Medium:
             return ImageSizeName.Medium;
         case PostHtmlEditing.ImageSize.Large:
             return ImageSizeName.Large;
         case PostHtmlEditing.ImageSize.Original:
             return ImageSizeName.Full;
         case PostHtmlEditing.ImageSize.Unknown:
             return ImageSizeName.Custom;
         default:
             Debug.Fail("Unknown image size: " + size.ToString());
             return ImageSizeName.Full;
     }
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:19,代码来源:ImageSizeControl.cs


注:本文中的ImageSize.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。