www.webdeveloper.com
Results 1 to 4 of 4

Thread: Loading cropped image into a variable

Hybrid View

  1. #1
    Join Date
    Oct 2013
    Posts
    4

    Loading cropped image into a variable

    Greetings fellow coders!

    Im working on a project which requires me to show a lot of cropped images onto a canvas element. Right now im starting off by putting the entire image in an image object, and im just defining an area of the image i wish to display. however. i dont know if it has any effects on performance, but i'd like to find out. so my question here is, is it possible to crop an image, and put the cropped image into a different image object? and if so, how?

  2. #2
    Join Date
    Oct 2013
    Posts
    2
    If you want something like this, no need to crop unless you want to.

    http://www.jpages.net/images/pics/Pics.htm

  3. #3
    Join Date
    Oct 2013
    Posts
    4
    no, im programming a top-town mmorpg, using canvas as the presentation method, nodejs for the server, and mongoDB as database. as you can immagine, a top down game would need spritesheets. currently im just cropping/clipping them to 32*32 at the time of placement onto the canvas using the canvas.drawImage() method. but every time i place an image, i have to crop/clip it to the dimensions i want. i can immagine this would require more processing power than just cropping/clipping the image once, save it into a new image object and place that on the canvas.

  4. #4
    Join Date
    Oct 2013
    Posts
    2
    Sorry, but that business is clear out of my ball park.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles