Results 1 to 16 of 16

Thread: Cut Sprites Out Of A Sprite Sheet...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Exclamation Cut Sprites Out Of A Sprite Sheet...

    In case you didn't know, this is a sprite sheet: http://fc05.deviantart.net/fs70/f/20...y7-d2ygn9z.jpg

    I would like to programmatically cut out each of those characters and save them as their own individual picture file. Any ideas?

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    Too bad they are not aligned up in even segments then you could use the PictureClip control


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Re: Cut Sprites Out Of A Sprite Sheet...

    I'd like to stay away from adding controls.

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    Would you accept simi-programatic?


    You could load the sheet into a Picturebox. Then using a selection rectangle (which you make) you capture the sprite in that rectangle and save it as an image file (bmp, jpg, gif, or whatever)


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  5. #5
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,681

    Re: Cut Sprites Out Of A Sprite Sheet...

    I've never understood sprite sheets....Do they seriously want to hit us with the tedium of having to remove them one by one in Photoshop ? I had to do that once and it really is tedious. I try to avoid sprite sheets whenever I can. What a retarded thing it is.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Re: Cut Sprites Out Of A Sprite Sheet...

    I'm actually figuring it out as we speak... to be continued.

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    In case you are interested in a simi-programatic way of doing it I included a simple program
    Attached Files Attached Files


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Re: Cut Sprites Out Of A Sprite Sheet...

    @jmsrickland - I LOVE IT! Although, it's not precise unless you've got some super steady hands and a rather large magnifying glass.

  9. #9
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    What do you mean not precise? It is exactly precise. Just draw the selection rectangle around each image

    I didn't want to take the time but I could have used a magnifier (like in MS Paint) to blow up the image area but as it is I find it very easy to draw the rectangle around each image - I can get the rectangle right up to the border of the image without any problem.
    Last edited by jmsrickland; Sep 19th, 2013 at 02:01 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Re: Cut Sprites Out Of A Sprite Sheet...

    By "precise" I meant to cut out each sprite without having extra space around the edges. Just hang tight... I'm about to provide my program in full.

  11. #11
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    You realize every image has to be in a rectangle, don't you. I'm not going to code to the extent that you cut out the exact outline of the image since that would be pointless because once saved it's going to be in a box anyway.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Re: Cut Sprites Out Of A Sprite Sheet...

    I understand and that wasn't what I was asking for. I was looking for code to do it automatically. Your code doesn't.

  13. #13
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    5,681

    Re: Cut Sprites Out Of A Sprite Sheet...

    Generally images in sprite sheets have to be cut out as rectangles. You use bitwise operations to invoke transparency when actually drawing the sprites in a game. That's how you get the exact image.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena


    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. -jmcilhinney

  14. #14
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Cut Sprites Out Of A Sprite Sheet...

    I posted that code with the statement that it was simi and only if you were interested in it. If you don't like it then don't use it. Besides it was a sample only and I didn't intend it to be everything you wanted. Read my disclaimer


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    119

    Resolved Re: Cut Sprites Out Of A Sprite Sheet...

    Okay. I've created a community gmail account.

    Username: vbforumsmail@gmail.com
    Password: vbforumsmail1

    Since I can't upload anything larger than 500k, you can use this. Just don't change anything and we can all use it. Use the honor system.

    You'll see my project (RPG Map Maker) in the GMail Inbox.

  16. #16
    PowerPoster
    Join Date
    Jun 2013
    Posts
    4,921

    Re: Cut Sprites Out Of A Sprite Sheet...

    The idea with the gmail-account to "share personal data" is a bit "indirect" I'd say
    (and inconvenient, especially for those who are currently logged in with a different gmail-account).

    Can't you just use one of the "Online-Space"-offerings - and then simply declare one of your "synced online-files" as "publically available" (and post that link instead)?

    E.g. Ubuntu One (http://one.ubuntu.com), which I use here allows that - and it offers 5GB-online-space for free.

    Here's the download-page for the Windows-based syncing-client: https://one.ubuntu.com/downloads/windows/

    Olaf

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width