Read-only archive of the All About Symbian forum (2001–2013) · About this archive

mpm on screen?

8 replies · 1,535 views · Started 14 November 2004

I am playing with OPL on my 9210i.

I am trying to load a .mpm picture to a screen as a background picture for my program, but haven't succeeded...
j%=gLOADBIT("...\pic.mbm",0)

Are there any restrictions like file size or number of colours or something else???

What you're doing is correct (it loads the picture). After doing that you still have to copy it to the main window to get is displayed. Here's an example routine that will load an image (just typed it in here and didn't check it, so there may be some errors in it, but it will give you an idea) and centers it on the main screen:

PROC DisplayMBM😞FileName$)
LOCAL iBmp%,iBmpW%, iBmpH%

REM Load the bitmap and store it's width and height
iBmp%=gLOADBIT(FileName$, 0)
iBmpW%=gWIDTH
iBmpH%=gHEIGHT

REM Select the main screen as active drawing screen and copy the bitmap to it
REM Mode flag at the end: 0-set, 1-clear,2-invert,3-replace
gUSE 1
gAT (gWIDTH-iBmpW%)/2, (gHEIGHT-iBmpH%)/2
gCOPY iBmp%, 0,0,iBmpW%,iBmpH%,3

REM Close the loaded bitmap
gCLOSE iBmp%

ENDP

PROC Main:
DisplayMBM😞"C:\Documents\Pic.mbm",0)
ENDP

I have:

LOCAL j%, bw%, bh%
j%=gLOADBIT("d:\Programs\OPL\Code\pic.mbm",0)
bw%=gWIDTH
bh%=gHEIGHT
gUSE 1
gAT(gWIDTH-bw%)/2, (gHEIGHT-bh%)/2
gCOPY(j%,0,0,bw%,bh%,3)
.
.
.
gCLOSE j%

But I think it is stuck to that gLOADBIT -line. There blinks some small screens for a short while and then the whole machine is stuck. I have to remove the battery and restart....

raksutiikeri wrote:No help??? 😞

What is the pixel size of the MBM file you're using?

Does it open in other MBM file compatible programs, e.g. Image on a 9210 and MbmView on a Psion?

You're right. Picture is not good. It causes an error.
Now I need to find a tool that converts pictures to mpm. I have one (ZnView), but it seems that it is not compatible with 9210i. Allthough it says it makes mpms for SymbianOS...

Any advice what program I should use to convert my pic to mbm?

That ZnView is new program I had different one before.
With this ZnView I can create mbm that I can view in my 9210i with a viewing program that is as default program.

But when I try to open it in OPL code, it says File is corrupt.
??

I'm not familiar with ZnView.

I am always using the two applications I mentioned above. The built in Image application on a Nokia 9210i can load a JPEG or GIF and save it as an MBM. You just need to select 'EPOC/App' in the Change Format options. I know this sounds cryptic (why couldn't Nokia just have said 'MBM'?) but what you get is an MBM file in 4096 colour format.

It works. Great. I opened a pic with the viewer 9210i has as default and saved the pic as Epoc pic. Now I can use it in my OPL code. Great!

Thank U a lot!!!