Image / sprite utility help

BlitzMax Forums/BlitzMax Programming/Image / sprite utility help

matibee(Posted 2011) [#1]
Hi all,

This was going to be a quick project to simplify supplying images with your text-only code samples. I thought it might be useful for the weekly coding challenges proposed in the beginners thread.

Part 1: A drag and drop utility to convert an image into a set of data statements.

Part 2: A simple data-to-image function.

The trouble is (which is why it's here and not code-arcs) the data-to-image function doesn't seem to work with non-square images. I've been off max for a while so is this a max2d or driver issue or something to do with the way I'm manipulating the pixmap? Perhaps it's just a stupid error on my part :/

The image to data converter (requires maxgui):


A sample (the brick image doesn't work tho)




Jesse(Posted 2011) [#2]
on the image converter you are not writing the data correctly.
The outer loop needs to be the height and the inner loop needs to be the width.

Last edited 2011


Jesse(Posted 2011) [#3]
a couple of mods in the demo also


Last edited 2011


matibee(Posted 2011) [#4]
Well spotted Jesse. Thanks.


col(Posted 2011) [#5]
Great little utility :)

Same as Jesse points out, but then in the image grabber - ReadPixel would then be wrong too, so this is correct :-



Last edited 2011