Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Images with 8-Bit-Memblocks

Author
Message
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 17th Dec 2007 18:56
Hi,

I am working on a small heightmap-editor as side-project and wanted to use a 8-bit-memblock for faster drawing. The problem is, that it doesn't work.

So there arise several questions:

1. Is it even possible to use 8-bit memblocks for images? (I mean, I don't need anything else than one byte to store a heightmap, so why should I use more bytes than neccessary?)
2. If so, how is it possible to manipulate them?

When trying to draw something onto the image (by changing the memblock-data) nothing happens, it just stays black (even if I randomize the pixel-data of the memblock). If I paste the image with transparency it at fist stays black and as soon as I drew something it gets invisible.

When searching through the forum I just found threads concerning 32 or 16-bit-memblocks, so I hope it's possible somehow to use the 8-bit-variant, would eneasy my work a lot.. However, I'd really appreciate any kind of solution. Thanks.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Dec 2007 18:21
Attached is a File I grabbed off some DB Related site - free source yada yada - has code for working with Matrix. Specificly for you - is the LOAD HEIGHTMAP function. NOW - it has the format for a 24bit Bitmap Load process - but I bet with a little effort - some googling - once you find the 8bit format online somewhere - you can make a loader like this one - and forget memblock conversion this or that - Just load the GFX and modify your "Terrain Heights Directly" OR Make a memblock - like an Array - and just load the thing - and access by read/write just bytes like you want

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-27 08:27:11
Your offset time is: 2024-09-27 08:27:11