Tuesday, January 15, 2013

Clipping Path

2 comments

Clipping Path

By using drawing image method you insert a image in canvas but you do not want to show all parts of the image.By clipping Path you can display certain part of image which is already drawn on the canvas.This is the burz al khalifa hotel in dubai.Firstly we draw this image on our canvas and then we just want to show the building roof and rest of the image will overlap.
Let's go how to do this.




sorry your browser doesnot support canvas tag.
<canvas height="300px" id="cp" width="400px">
sorry your browser doesnot support canvas tag.
</canvas>


<script type="text/javascript">
var sex=document.getElementById("cp");
var sec=sex.getContext("2d");
var img=document.getElementById("clip");
sec.beginPath();
sec.moveTo(10,0);
sec.lineTo(120,50);
sec.lineTo(150,80);
sec.lineTo(170,130);
sec.lineTo(150,150);
sec.lineTo(50,100);
sec.clip();
sec.drawImage(img,10,10);

</script>
Here i give the above image id is clip and got this image and save it to a variable.Then Create a custom shape by using old tools moveTo and lineTo methods.When we draw our boundary then tell the browser now cut rest of the image part by calling clip() method.Play with the line to and move To values and you can find a lot of interesting thing on it.

Comments

2 comments to "Clipping Path"

Unknown said...
June 16, 2014 at 12:56 PM

When you are thinking image editing services like Photoshop Clipping Path, Image Masking, Image Restoration, Photo Retouching, Photo Enhancement, Raster to Vector (R2V) tasks, Color Correction, Image Manipulation, Image shadow creation etc. then your are in right place.GraphicExpoBd.Com is providing the most reliable and best quality online graphics solution all over the world. Our talented professionals are providing the most promising graphics design services like Photoshop Clipping Path, Image Masking, Image Restoration, Photo Retouching, Photo Enhancement, Raster to Vector (R2V) tasks, Color Correction, Image Manipulation, Image shadow creation, Logo Design, Catalog Design and so many more. Since 2006 with 24/7 hours customer support. To differentiate our working quality you can give us free trial our dedicated support crews are ready to fire.

Please visit our site for more details.
http://www.graphicexpobd.com/

We would like to build a long term business relation if you give me the opportunity. Hope you will enjoy our quality services round the 24/7/365 at a reasonable price.

Thanks & Regards
M H Khan
COO at Graphic Expo
http://www.graphicexpobd.com/

Unknown said...
June 16, 2014 at 12:59 PM

GraphicExpoBd.Com is providing the most reliable and best quality online graphics solution all over the world. We are from Bangladesh! Additionally we have 4 branches respectively in USA, Switzerland, UK, and Australia. We have been providing services since 2006 with 24/7 hours customer support. You can differentiate our working quality with timely project delivery by giving us free trials at any time when you want!

Why You Choose Us:

>>> We have dedicated 35 expert graphic designers who are so much talent, creative and graduate in there zone.
>>> We are working 24/7 hours in a week with 3 shifts.
>>> 24 hours email support from our customer service department.
>>> We are using two internet service providers routing through different channel as a backup connection with 10 Mbps dedicated internet connection.
>>> We have enough computers (PC & MAC) to perform all type of job.
>>> We have 50 kV own standby power generator and 4000 VA IPS model for power disaster.



Contact Information:
Switzerland Office:
Heerstrasse 13 CH-8853 Lachen.
Phone : +41 55 556 82 80
Mobile : +41 76 568 01 67
Skype : Daniel Kilian
Email : dk@web-medien.com
Email : support@graphicexpobd.com

USA Office:
315 Wall street Danville PA 17821.
Phone : +1 570 275 2705
Skype : Scott Staley
Email : scott.staley@verizon.net
Email : support@graphicexpobd.com

Production House (Bangladesh):
Road # 03, House No # 69/A, Mohammadia Housing Ltd, Dhaka-1207.
Phone : (+880) 28623455
Skype : Graphic Expo
Email : info@graphicexpobd.com
Email : graphicexpobd@gmail.com

Post a Comment

 

Copyright 2010 All Rights Reserved E-tech institute of IT.