View+ Forum Index View+
Review http://mypsion.ru/viewplus.php
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   Join! (free) Join! (free)
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MBMBind code snippet

 
Post new topic   Reply to topic    View+ Forum Index -> ER5 OPL corner
View previous topic :: View next topic  
Author Message
Please Register and Login to this forum to stop seeing this advertsing.






Posted:     Post subject:

Back to top
Edo



Joined: 10 Aug 2005
Posts: 390


Location: Prismen - Vis

PostPosted: Thu Sep 22, 2005 1:49 pm    Post subject: MBMBind code snippet Reply with quote

Now let's see how to bind single bitmap files into one MBM file.
Since you've already installed View+, the easiest way is to take use of CLIPBIT.OPX.

Edo



Code:

REM MbmBind code snippet ŠEdo   22.09.05.
REM Bind single bitmap files into one MBM file
REM Bitmap files must be named like 000.mbm, 001.mbm, 002.mbm etc...
REM MBM file will be created in the same folder where source files are found
REM CLIPBIT.OPX must be installed in your \system\opx\ folder

INCLUDE "Const.oph"
INCLUDE "Clipbit.oxh"

PROC MbmBind:
   LOCAL path$(255), MBM$(255), bitmaps%
   
   MBM$ = ".mbm"
   dINIT "Bind bitmaps into single MBM file", KDlgButRight%
   dEDIT MBM$, "MBM file name", 15
   dFILE path$, "Source folder", KDFileFoldersOnly% + KDFileSelectorWithSystem%
   dBUTTONS "Cancel",KDButtonEsc%, "Ok",KDButtonEnter%
   IF 0 = DIALOG
      STOP
   ENDIF

   bitmaps%=MbmBind%:(Path$, MBM$)
   PRINT ""
   PRINT "Added", NUM$(bitmaps%,3), "bitmaps"
   IF EXIST(MBM$)
      PRINT "MBM file", MBM$, "created"
   ENDIF
   PRINT "Press any key to close"
   GET
ENDP

PROC MbmBind%:(path$, mbm$)
   LOCAL dummy%, bitfile$(100,150), bitmaps&, bid&(100), i%

   PRINT "Binding bitmaps to", mbm$, CHR$(133)
   PRINT ""
   
   IF NOT EXIST(Gen$:(path$, 0))
      PRINT "Nothing to bind!"
      RETURN
   ENDIF

   i% = 1
   DO
      bid&(i%) = 0
      bitfile$(i%) = Gen$:(path$,i% - 1)
      PRINT "Added", bitfile$(i%)
      i%=i%+1
   UNTIL NOT EXIST(Gen$:(path$,i% - 1)) OR i%=101

   bitmaps& = i% - 1
   IF BitmapToMBM%:(MBM$, bitmaps&, dummy%, bid&())
      PRINT "Error binding bitmaps!!!"
   ELSE
      RETURN i% - 1
   ENDIF
ENDP

PROC Gen$:(path$, no%)
   RETURN (path$ + RIGHT$("000" + NUM$(no%, 3), 3) + ".mbm" )
ENDP



Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    View+ Forum Index -> ER5 OPL corner All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Create your own free forum | Buy a domain to use with your forum
Free Web Counter