Click to See Complete Forum and Search --> : Graphics, Windows and The MBM File Format...


cyberneticist
10-18-2002, 10:25 AM
Hi there! Does anyone know the file format specification for MBM? I developed my own compressed graphic format, which I use quite extensively in my own programs for archiving. However, it takes a very long time to actually load up one of these, as I cannot directly access the memory cell which makes up a bitmap or window - does anyone know how to do this in OPL32?

As an alternative to trying to load up the image, another solution would be to convert the file directly into an MBM file, then open that in the window, as that takes *much* less time to do!!! However, a browse of the net has been less than helpful in finding out exactly how an MBM file is structured. I guess there must be some type of compression (and I would guess from the file size and save/load times that it must be run-length) Does anyone know the file format?

Thanks in advance!!!!!

ktkawabe
10-21-2002, 09:32 AM
Hi cyberneticist,

Unfortunately video memory cannot be directly accessed from OPL (but anyway normal C++ apps are not doing that either).
Have you tried drawing to bitmap and then copying them to the window, rather than using draw-related commands directly to the window? This makes it much faster as far as I remember.

As for the file format, you can find an almost complete description from the developer of psiconv here:
http://huizen.dds.nl/~frodol/psiconv/html/Index.html

MBM does support compression (RLE), but you can also leave it uncompressed.

Good luck,
Keita

cyberneticist
10-22-2002, 05:02 AM
Thank you ever so much for that Keita! That was an amazing help. I had a feeling that accessing the window memory may be a little tricky! :) The MBM format information is something I haven't been able to find anywhere, so thank you ever so much for pointing me in the right direction!!!!!

Beakynet
10-22-2002, 07:02 AM
Originally posted by ktkawabe

Unfortunately video memory cannot be directly accessed from OPL (but anyway normal C++ apps are not doing that either).


I guess it would be possible, if you could find the address of the video memory. In OPL you can poke and peek and there are functions that return if a part of the screen is drawn on.

If anyone knows how to get the video memory address for a window, then it will be possible. I looked into this for one of my programs but couldn't fing the address.

:confused:

ktkawabe
10-22-2002, 11:33 AM
Hi Beakynet,
I guess it would be possible, if you could find the address of the video memory. In OPL you can poke and peek and there are functions that return if a part of the screen is drawn on.
Well, probably no ;).
When poking into "memory", what you are actually doing is to poke into an area in memory which is specially allocated by OPL interpreter for your running OPL program. The parameter passed to POKE is actually not the absolute memory address itself, it is some kind of relative position in that OPL-only memory area. So, as far as you use the existing OPL functions and/or OPXs, it doesn't seem to be easy to touch the video directly. (But I may be wrong :D)

It should still be possible to manipulate the video memory by using GDI directly (i.e. you write your own OPX by using C++), but even using C++ it's generally a better idea to use EPOC higher-level API (CONE/EIKON) instead. If you are interested in this approach (i.e. using higher-level API from OPX), please take a look at the sourcecode of my JPPrint OPX:
http://www.hi-ho.ne.jp/~ktkawabe/densha_e.html
It draws the Japanese characters on the OPL windows on non-Unicode Psions. Please don't expect a quality piece of code, though... :)