doupuzhimuhan9216 2012-10-23 20:51
浏览 45
已采纳

在透明圆上渲染图像并裁剪它

I have a background image: enter image description here,

on which i fuse a circle(or eclipse): enter image description here

so that the area equal to circle becomes transparent on the background image just like this: enter image description here.

I have used php and image magick to achieve this

Now, I have to insert an image into the hole in such a way that:

  1. Image is rendered above the background, so only image area equal to photo hole is visible.
  2. When I drag the image in photo hole, the image goes in layer behind background and when released again the image is re-rendered as step 1.
  3. I also need to crop the image rendered in step 1.

How this can be achieved in php using image magick? Any pointers or help will very useful.

To transfer image below the background on layer, can this be done using z-index?

  • 写回答

2条回答 默认 最新

  • dongshou2024 2012-12-01 12:01
    关注

    In order to achieve the above, I took this appraoch:

    1. I place a image in a div (exactly surrounding the circle) which is behind the background image. The div has overflow hidden, so I can contain image.

    2. In order to drag image I transfer mouse down event on background image to the below div. This can be done using jQuery trigger.

    3. Now to crop the image I calculate the x,y offset of images and crop height and width accordingly and send data to server to crop it.

    Hope this helps someone else.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 centos7.6进不去系统,卡在数字7界面
  • ¥15 Tensorflow采用interpreter.allocate_tensors()分配内存出现ValueError: vector too long报错
  • ¥15 使用CGenFF在线生成血红素辅基拓扑结构遇到问题
  • ¥15 在fragment使用okhttp同步上传文件,能不能在fragment销毁后还可以继续上传文件?
  • ¥20 matlab代码实现可达矩阵形成骨骼矩阵
  • ¥15 关于地板的木纹和图库中的匹配的
  • ¥30 机器学习预测疾病模型流程疑问
  • ¥50 2048Python实现
  • ¥15 使用ads进行低噪放仿真没有结果且不报错
  • ¥15 关于#python#的问题:有偿求一个千寻框架找书机器人插件
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部