TileMap Preview (need help)

BlitzMax Forums/BlitzMax Programming/TileMap Preview (need help)

MacSven(Posted 2010) [#1]
Hi,

I am Writing a TileMap Editor for MaxOS X and i have a problem to
extract a tile form a Tilemap image.

I load the tilemap as a timage object, the preview for the full image works with
Drawimagerect perfect.

The Problem is now how can i make a preview of only one tile of the image to create a preview, only for this tile.

GrabImage does not work?

Has someone a little idea?

Regards
Sven


H&K(Posted 2010) [#2]
http://www.blitzbasic.com/Community/posts.php?topic=72617#811829

I know it answers more than you asked, but Its a nice Thread by some Bmax vets about this sorta thing, with code


MacSven(Posted 2010) [#3]
Thanx for the Samples. I have found it.

But now:

What is the different between a tpixmap and a timage, and can i
convert a timage to a tpixmap?

Regards
Sven


shinkiro1(Posted 2010) [#4]
Every TImage contains a TPixmap (look in the source code of bmax)
As far as I know you should only use Pixmaps to manipulate pictures at the pixel level. Drawing them is a no go as they are very slow.

Local myImage:TImage = LoadImage( LoadPixmap(path) )

This is a possibility how you can convert a pixmap into a TImage(untested), however there may be more efficient ways of doing it.


Jesse(Posted 2010) [#5]
or you can access a pixmap from an image:
local pixmap:TPixmap = LockImage(image)
.
'modify pixmap
.
UnLockImage(image)
DrawImage,image,x,y


any modification to the pixmap will directly affect the image.