Jump to content
Sign in to follow this  
AARRGGHHH

How do I size a Canvas without resizing the image inside?

Recommended Posts

I have resized an image to fit inside a canvas without any problems.  However, now I need to resize a canvas without resizing the image that it contains.  How do I do this? 

Thank You

Share this post


Link to post
Share on other sites

You can changing the size of the surface of the canvas by changing its width and height properties using Javascript. After this, though, you will need to call the drawImage() function again since resizing the canvas also clears its content.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×