css - 在 SVG 中翻转 PNG

标签 css html image animation svg

我想翻转嵌入到我的内联 SVG 中的 png 文件,因为包含的元素会导致它上下颠倒。我试过用 transform:rotate(180deg); 之类的东西编辑包含它的 id="path104"元素。但这将它从屏幕上移开。

代码:

https://codepen.io/anon/pen/ZqBVjq

PNG 本身作为模式嵌入到 id="defs453"中。

<defs id="defs453">

    <pattern id="pattern-image-browser-filling" x="0" y="0" width="1" height="1">

      <image xlink:href="https://image.ibb.co/gtoOip/sdfgh.png" width="893.5" height="446.8"></image>

    </pattern>

  </defs>

最佳答案

您需要转换图像:scale(1,-1) 以进行垂直翻转。然后翻译回来translate(0,-446.8)

<image transform="scale(1,-1) translate(0,-446.8)" xlink:href="image.ibb.co/gtoOip/sdfgh.png"; width="893.5" height="446.8"></image> 

关于css - 在 SVG 中翻转 PNG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52703337/

相关文章:

jquery - 将动画添加到 div 中的其中一张图像

访问 Imageview[] 数组时出现 java.lang.NullPointerException - Javafx

c# - asp.net c# 中的动态 imageURL

html - 部分透明的背景图片

CSS 过渡 - 问题

javascript - 我可以在 1 个页面中运行 2 个相互重叠的 JQuery 函数吗?

javascript - 是否可以从 HTML5 音频元素获取 Icecast 元数据?

html - Bootstrap : How to make a background image sit between the edge of the container and the edge of the body?

javascript - 无法隐藏 Monaco Editor

html - 为什么我的填充仅在元素处于悬停状态时显示?