For a project I am able to print a small BMP (40x30 pixels) but it is being painted with the whole 320x200 pixels as well (with some background color taken from the BMP Palette). Can I just put a small BMP on the screen in a limited area without affecting an exiting picture that is already there? 16 bit TASM 8086.
Asked
Active
Viewed 99 times
0
-
Yes, sure, just copy each row from the BMP to the corresponding part of a row of VGA memory. The rectangle you're writing is part of a larger image, so the stride between rows is 320 pixels, different from the width of the rectangle you want to store. – Peter Cordes Jun 01 '20 at 00:18
-
Hi Peter , apparently I can put my small BMP where I need but I see left over pixels that are placed all over the remaining pixels. I need an overlay feature that should not destroy the whole picture. Should I clear something prior putting this small BMP or change my VGA graphics mode from 0x13 ? – Arik Pickholz Jun 01 '20 at 06:13
-
Ok, so don't modify pixels outside of the area where you want your BMP displayed. If your code wasn't intentionally writing pixels outside that area, debug it so it doesn't. – Peter Cordes Jun 01 '20 at 06:16
-
Thanks. I am not writing anything else intentionally to the screen memory. I am not aware who writes these pixels. – Arik Pickholz Jun 01 '20 at 08:50
-
Use a debugger. Set a watch-point on video RAM outside that square and see what's writing it. e.g. QEMU+GDB or BOCHS with it's built-in debugger can probably do this. – Peter Cordes Jun 01 '20 at 08:52
-
Just an update : by altering the base address for the video from 0x0a000 to a larger number It helped me get rid of the unneeded parts I had seen on my screen. – Arik Pickholz Jun 01 '20 at 20:20