sciter 获取软件图标显示

<html>
  <head>
    <style>
      select.file-list > option
      {
        behavior:file-icon;
        padding:2dip 2dip 2dip 20dip;
        foreground-repeat: no-repeat;
        foreground-position: 2dip 50%;
        foreground-image:url(images/unknown-icon.png);
      }

      
      select.file-list > option:invalid { /* file not found */
        color:gray;
      }
      
      widget.file-list
      {
        width:*;
        height:min-content;
        flow:h-flow;
        border-spacing:3dip;
      }
      widget.file-list > option
      {
        behavior:file-icon;
        foreground-repeat: no-repeat;
        foreground-position: 50% 2dip;
        foreground-image:url(images/unknown-icon.png);
        width:max-intrinsic;
      }

      widget.file-list.large > option
      {
        -icon-size:"large"; // use large icons
        padding:32dip 2dip 2dip 2dip;        
      }
      widget.file-list.x-large > option
      {
        -icon-size:"x-large"; // use x-large icons
        padding:48dip 2dip 2dip 2dip;        
      }
      widget.file-list.xx-large > option
      {
        -icon-size:"xx-large"; // use xx-large icons, a.k.a. "jumbo"
        padding:256px 2dip 2dip 2dip;
        width:256px;
      }


      /* image-transformation can be applied to icons too: */
      widget.file-list > option:current
      {
        foreground-image-transformation: hue(highlight);
      }
      
    </style>
  </head>
<body>
  <h1>behavior:file-icon sample</h1>
  <p>behavior:file-icon Windows Shell services to retrieve and draw icon associated with the file or extension.</p>
  <p>To get file name behavior:file-icon is using value of <code>filename</code> attribute.
     If there is no such attribute then it uses <b>text of the DOM element</b> as a file name.</p>
  <p>&lt;select&gt; with &lt;option&gt;s using behavior:file-icon:</p>
  <p>text as a file name:  
  <select .file-list size=6>
    <option>c:\windows\notepad.exe</option>
    <option>c:\windows\regedit.exe</option>
    <option>c:\windows\system.ini</option>
    <option>c:\windows\explorer.exe</option>
    <option>c:\windows\twain.dll</option>
    <option>c:\unknown.unk</option>
  </select> and with attribute filename:
  <select .file-list size=6 >
    <option filename="c:\windows\notepad.exe" >c:\windows\notepad.exe</option>
    <option filename="c:\windows\regedit.exe" >c:\windows\regedit.exe</option>
    <option filename="c:\windows\system.ini"  >system.ini</option>
    <option filename="c:\windows\explorer.exe">explorer.exe</option>
    <option filename="c:\windows\twain.dll">twain.dll</option>
    <option filename="c:\unknown.unk">unknown.unk</option>

  </select></p>
  <p>Use -icon-size:"large" CSS attribute or icon-size="large" DOM attribute if you need to use large icons:</p>
  <widget type="select" .file-list .large >
    <option filename="c:\windows\notepad.exe" >notepad.exe</option>
    <option filename="c:\windows\regedit.exe" >regedit.exe</option>
    <option filename="c:\windows\system.ini"  >system.ini</option>
    <option filename="c:\windows\explorer.exe">explorer.exe</option>
    <option filename="c:\windows\twain.dll">twain.dll</option>
    <option filename="c:\windows\nonexistent.dll">nonexistent.dll</option>
  </widget>         
  <p>icon-size:"x-large"</p>  
  <widget type="select" .file-list .x-large >
    <option filename="c:\windows\notepad.exe" >notepad.exe</option>
    <option filename="c:\windows\regedit.exe" >regedit.exe</option>
    <option filename="c:\windows\system.ini"  >system.ini</option>
    <option filename="c:\windows\explorer.exe">explorer.exe</option>
    <option filename="c:\windows\twain.dll">twain.dll</option>
    <option filename="c:\windows\nonexistent.dll">nonexistent.dll</option>
  </widget>
  <p>icon-size:"xx-large"</p>  
  <widget type="select" .file-list .xx-large >
    <option filename="c:\windows\notepad.exe" >notepad.exe</option>
    <option filename="c:\windows\regedit.exe" >regedit.exe</option>
    <option filename="c:\windows\system.ini"  >system.ini</option>
    <option filename="c:\windows\explorer.exe">explorer.exe</option>
    <option filename="c:\windows\twain.dll">twain.dll</option>
    <option filename="c:\windows\nonexistent.dll">nonexistent.dll</option>
  </widget>         

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值