ID:136988
 
I just thought up a terrific way to use this, but I don't think BYOND has any support for it at all. So I'd like to request an option to cut bits of larger images like .pngs or .bmps and turn them into icons. So I could do something like this:

mob/New()
icon = CutImage('picture.png',5,5)

This would take the 5th square from the edge, and the 5th square from the bottom, and turn it into an icon for the mob. If the image isn't large enough, it could just return null. Not sure how doable this is for you guys, but if you can do it, I can use it.

Thanks,
Awakening
You can't do this at runtime but you can do it in Dream maker just import the picture into the icon editor and it should cut the icon up.
In response to Nadrew (#1)
I can do that with an image editor too, but what I really need is for this to happen during runtime.
Awakening wrote:
I just thought up a terrific way to use this, but I don't think BYOND has any support for it at all. So I'd like to request an option to cut bits of larger images like .pngs or .bmps and turn them into icons. So I could do something like this:

mob/New()
icon = CutImage('picture.png',5,5)

This would take the 5th square from the edge, and the 5th square from the bottom, and turn it into an icon for the mob. If the image isn't large enough, it could just return null. Not sure how doable this is for you guys, but if you can do it, I can use it.

Fortunately, you can already do this. A big icon's icon states look like this:
""     // shrunken version of the icon
"0,0" // lower-left corner (0,0 is the offset)
"1,0" // move right one
...


So you can do:
mob
icon = 'picture.png'
icon_state = "4,4"
In response to Tom (#3)
Great! That's just what I need! Thanks Tom!
In response to Awakening (#4)
I was just about to edit my post to state (which I forgot about) how it named the icon_states by tile. =P