Programmatically Clip/Cut image using Javascript

后端 未结 8 1809
[愿得一人]
[愿得一人] 2020-12-12 17:57

Are there any documents/tutorials on how to clip or cut a large image so that the user only sees a small portion of this image? Let\'s say the source image is 10 frames of

相关标签:
8条回答
  • 2020-12-12 18:28

    CSS also defines a style for clipping. See the clip property in the CSS specs.

    0 讨论(0)
  • 2020-12-12 18:29

    The width/height properties of the document's image object are read only. If you could change them, however, you would only squish the frames, not cut the frames up like you desire. The kind of image manipulation you want can not be done with client-side javascript. I suggest cutting the images up on the server, or overlay a div on the image to hide the parts you do not wish to display.

    0 讨论(0)
提交回复
热议问题