【问题标题】:Sitecore Media Options default background color changeSitecore 媒体选项默认背景颜色更改
【发布时间】:2013-10-03 04:33:58
【问题描述】:

我们可以将 Sitecore 的媒体选项默认背景颜色更改为白色吗?默认为黑色。

否则当我需要图像时,我不得不说,背景颜色是白色。

 Sitecore.Resources.Media.MediaUrlOptions mediaUrlOptions = new Sitecore.Resources.Media.MediaUrlOptions(this.GetCurrentDatabase, false)
                {
                    Width = 480,
                    Height = 360,
                    BackgroundColor = System.Drawing.Color.White
                };

http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/05/Media-Options-and-Query-String-Parameters-in-the-Sitecore-ASPNET-CMS.aspx

【问题讨论】:

    标签: c# asp.net sitecore


    【解决方案1】:

    web.config 中的这个设置应该可以解决问题:

    <!--  MEDIA - DEFAULT IMAGE BACKGROUND COLOR
          The default background color for dynamically resizing images to different aspect ratios than the originals. 
          Sitecore applies this background color only for image types that do not support transparency (image/jpeg, image/gif and image/bmp).
          When resizing any other image types (including image/png), Sitecore always applies a transparent background.
          You can specify a color name (such as Black or Red) or a hex color code (such as #CE55E2).
          If you specify no value, Sitecore applies a black background color when resizing such images. 
          Default value: "" 
    -->
    <setting name="Media.DefaultImageBackgroundColor" value="White" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-15
      • 1970-01-01
      相关资源
      最近更新 更多