flat assembler
Message board for the users of flat assembler.

Index > Tutorials and Examples > bmpgen, generate a bitmap based on text.

Author
Thread Post new topic Reply to topic
retro



Joined: 12 Oct 2021
Posts: 47
retro
here's the code, you can see that i commented out a (untested, copy & pasted) rng, you can make the generator generate a random pattern-based image, but the "default" is to get the user input and then store it in a 32bpp bitmap.
https://pastebin.com/rV6msppB
Post 27 Jul 2022, 10:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18844
Location: In your JS exploiting you and your system
revolution
To avoid links going stale you can also post the code directly to this board either as an attachment, or as inline text when it isn't too long.
Post 27 Jul 2022, 10:58
View user's profile Send private message Visit poster's website Reply with quote
retro



Joined: 12 Oct 2021
Posts: 47
retro
yeah, i know, i do that 'cos i'm used to send code via pastebin lol
Post 27 Jul 2022, 12:49
View user's profile Send private message Reply with quote
FlierMate1



Joined: 31 May 2022
Posts: 118
FlierMate1
It is working but I cannot understand the content of this 8x8 bitmap.
EDIT: "a random pattern-based image", ah, now I see what it is.

For example, my screenshot shows a 2000% magnified bmpgen.bmp.


Description: 8x8 bitmap after keying in "flatassembler"
Filesize: 4.14 KB
Viewed: 342 Time(s)

Screenshot 2022-07-27 215624.png




Last edited by FlierMate1 on 27 Jul 2022, 14:07; edited 1 time in total
Post 27 Jul 2022, 13:59
View user's profile Send private message Reply with quote
retro



Joined: 12 Oct 2021
Posts: 47
retro
it's simple, the characters you type are bytes, and then these bytes fill the variable conten, and then this variable fills the bmp file starting at offset $7a, turning the bytes into colors. each 4 bytes is actually a pixel, so if you type "abcd", then you'll get $61,$62,$63,$64, which turns into gray on bitmap.
Post 27 Jul 2022, 14:07
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.