<div style="clear: both;">///////////////////////////////////////////////////
// Random 24bit Bitmap Generator by Leif902
// Copyright 2005, Leif902.
// All rights Reserved.
// This script may be used freely by anyone so long as credit is given and
// modified scripts are clearly marked as such and this notice remains intact
// in the script.
// Thank you -Leif902
// Wednesday, December 21, 2005
///////////////////////////////////////////////////
var file,numoflongsm,byte;
// Make the bitmap... not a great way of doing it, but it works.
file_text_close(file_text_open_write(argument0));
file = file_bin_open(argument0,1);
// Write Bitmap File Header
file_bin_write_hex(204885314,4,file);
file_bin_write_hex(0,4,file);
file_bin_write_hex(3538944,4,file);
file_bin_write_hex(0,2,file);
// Write Bitmap Information Header
file_bin_write_hex(40,4,file);
file_bin_write_hex(32,4,file);
file_bin_write_hex(32,4,file);
file_bin_write_hex(1572865,4,file);
file_bin_write_hex(0,4,file);
file_bin_write_hex(3072,4,file);
file_bin_write_hex(0,4,file);
file_bin_write_hex(0,4,file);
file_bin_write_hex(0,4,file);
file_bin_write_hex(0,4,file);
// Write Random Bitmap
for (i=0;i<=3072*2;i+=1)
{
byte = floor(random(256));
file_bin_write_hex(byte,1,file);
}
file_bin_close(file);</div>
The script above (I have not written it myself, as you can see) generates a real bitmap file. For this the author uses hex. What is really good about this, I think, is that he really have taken his time to study the structure of bitmaps. He hasn't just gone looking for a DLL.
Yet again we have a proof of the fact that the limitation to what you can do in Game Maker relies at least 90% on the programmer. Next time you want to be able to save your files using different file formats, don't go out looking for a DLL which you will learn nothing from. Study the format itself.
You can find an example and other useful stuff at the authors homepage:
http://software.greenmangames.vze.com/
.
Users logged in:
Comments
Loading comments...