私は透明なオーバーレイを使用して、下にあるsvgアイテムの基本色にテクスチャを追加することで、かなりうまく動作しているsvgでペーパーテクスチャの外観を作成しようとしています。静的な塗りつぶしサイズを維持しながら、SVGスケールを親に合わせることは可能ですか?
しかし、私は、テクスチャがSVGに比例することに気付きました。画像はページの幅に設定されているので、大型モニターでは非常に伸びてしまい、とても見苦しくはありません。
固定サイズのパターン塗りつぶしで、svgアセットのスケールを自動的に設定できますか? http://codepen.io/mix3d/pen/jWMPQE
EDIT:更新SVGは、中心から充填タイルと伸ばすことができれば、実際のSVGはなく、理論的
ボーナスポイントとcodepenここ
は完全な例であるcodepen 。ありがとう!
これは、SVGが現在どのように見えるかですが、SVGとテクスチャスケール
<svg version="1.1" id="paper_svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="10 0 1526 407.93">
<style type="text/css">
.overlay{fill:url(#img1);fill-opacity:1;}
.circle{fill:#62B4B8;}
</style>
<defs>
<pattern id="img1" patternUnits="userSpaceOnUse" width="243" height="201">
<image xlink:href="http://i.imgur.com/grtbkje.png" x="0" y="0" width="486" height="402" />
</pattern>
<filter id="f3" x="-40%" y="0" width="180%" height="400%">
<feOffset result="offOut" in="SourceAlpha" dx="0" dy="3" />
<feGaussianBlur result="blurOut" in="offOut" stdDeviation="3" />
<feColorMatrix in="blurOut" result="transparency" type="matrix"
values="0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 .5 0"/>
<feBlend in="SourceGraphic" in2="transparency" mode="normal" />
</filter>
</defs>
<g>
<circle id="Background_Circle" class="circle" cx="280.52" cy="226.67" r="166.67"/>
<!-- I know I could probably use a filter to achieve the same overlay effect, but this worked for now, duplicate the object with the semi-transparent fill pattern -->
<circle id="Background_Circle" class="overlay" cx="280.52" cy="226.67" r="166.67"/>
</g>
</svg>
@RobertLongsonは、あなたがそれのいずれかの例がありますか?私は彼らが埋め込むことができると確信している、ちょうどチェックしたい。ありがとう! – mix3d
背景イメージを使用しない理由は何ですか?それは容易に中心合わせされ、タイル張りされるだろう。 –
@JesseKernaghan主な理由は、実際のsvgが矩形ではなく、「ペーパーカット」エッジのポリゴンであるためです。 – mix3d