PDA

View Full Version : * Free * : Dynamic Masking Tool (DMT V2)



clueless
02-01-2008, 05:35 PM
Overview
This is a Version2 tool for dynamic mixing of background masks in AMS to give the illusion of an extending 'Draw or Draws' on the side of the main program window. file size 24kb :cool .It can be set up for multiple draws extending to many levels.
Info on the orig version/concept can be found here: http://www.indigorose.com/forums/showthread.php?t=17863&highlight=dmt

http://www.fataloverdose.copperstream.co.uk/files/programming_tools/dmt/dmt_examplepic_web.gif

This version is using Direct Memory Access to perform the pixel operations and is at least 13x faster than V1 :yes
Using the DMT
This is a Command Line Tool so its an .EXE file that has to have 3 bits of data passed to it to mix the masks. Note : all filenames have to be passed as 'short filenames' to avoid extra spaces in the command line.
Syntax


[MainPic] [Action] [Draw]

[MainPic] :A mask image of the program window with all the draws open
[Action] : Either 'Add' or 'Sub' to add or remove a draw from the main Mask image
[Draw] : A Mask image of a draw in the open position

Example:


CommandLine = MainPic.." ".."Sub".." "..ADrawPicLocation;
File.Run("AutoPlay\\Prg\\DMT.exe", CommandLine, "", SW_SHOWNORMAL, true);


Global Functions example:


function OpenDraw(ADrawPicLocation)
RunDMT (MainPic.." ".."Add".." "..ADrawPicLocation);
Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Keys.ogg", true, false);
return true
end
----------------------------------------------------------------------------------------------------------------
function ShutDraw(ADrawPicLocation)
RunDMT (MainPic.." ".."Sub".." "..ADrawPicLocation);
Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Knocker.ogg", true, false);
return false
end

Download
This prog is free for you to use in your own projects. A small note of credit would be appeciated in anything you use it for.
Heres a quick example of how to use the DMT, its a demo prog with a few random functions in it.
Download DMT_Clueless.rar (http://www.fataloverdose.copperstream.co.uk/files/programming_tools/DMT_Clueless.rar)

Next ill be converting this and whole bunch of other image/picture functions into a DLL file which i that I may charge a small fee for.

mindstitchdr
02-01-2008, 06:13 PM
Clueless I would love to use this but unfortunatly I haven't upgraded to AMS 7. If it's not too much trouble could you make the example for AMS 6? Please

clueless
02-01-2008, 06:46 PM
Done.. http://www.indigorose.com/forums/showthread.php?p=114696#post114696

mindstitchdr
02-01-2008, 06:54 PM
Thank you!

Lorne
02-05-2008, 11:33 AM
Nice demo. :)

clueless
02-23-2008, 10:30 PM
Thanks for the support guys :yes

Heres the final version of the DMT with some optional optimization.
Filesize : 112kb :cool

Standard Drawing Mode-(v2 method) The DMT scans every pixel of the 'draw' image and add's or subbtracts the picture to the main mask.

Optimized Drawing mode -You can 'pre-calculate' the area of the draw image so that only the horizontal lines of pixels that contain white get scanned to the main mask image. This can be up to 3 times faster to process than the old method.

PreCalc Tool-Because of the way bitmaps are stored for fast direct memory access it takes a certain amount of calculation based on the width of the pic x (the bytes per pixel and the spacers in between each pixel) etc..to get the two numbers needed (startPixel,EndPixel) to make the optimization work. So to make this less stressful ive added a function to the DMT to do the maths for you :D. You dont have to run this every time you want to open the draws you just run it one time for each draw you have to find the magic numbers and then use them in your code -

StartPixel,EndPixel-Doubble click the DMT in windows(no commandline) to open up the 'Pre-Calc' tool then select a 'draw' (you will have to do this once for each draw, but not the main mask) image and the program will give you the start and end pixel numbers needed to speed the drawing process up.

CommandLine Syntax
So the DMT is multi-functional now it can be used 3 ways ;-

Standard Drawing Mode:- [ImgMain] [Method] [imgDraw]

Optimized Drawing mode:- [ImgMain] [Method] [imgDraw] [startpixel] [EndPixel]

DMT PreCalc Tool:
- Just double click DMT.exe in windows.
- Select Draw
- add the numbers to the end of the commandline.

Note: all filanames have to be 'short filenames' to avoid extra spaces in the commandline ;)

Sorry about the rapidshare download but the demo progs to big to upload here
http://rapidshare.com/files/94425349/DMT3.apz

This is the command line program on its own.

rexzooly
02-24-2008, 09:44 AM
Soon as i get a upload script working i will let AMS users that offer progamers and Examples to there AMS member free uploading its a standard websever so
none of this one time or slow downloads :)

Intrigued
02-24-2008, 02:35 PM
Thanks for the support guys :yes

Heres the final version of the DMT with some optional optimization.
Filesize : 112kb :cool

Standard Drawing Mode-(v2 method) The DMT scans every pixel of the 'draw' image and add's or subbtracts the picture to the main mask.

Optimized Drawing mode -You can 'pre-calculate' the area of the draw image so that only the horizontal lines of pixels that contain white get scanned to the main mask image. This can be up to 3 times faster to process than the old method.

PreCalc Tool-Because of the way bitmaps are stored for fast direct memory access it takes a certain amount of calculation based on the width of the pic x (the bytes per pixel and the spacers in between each pixel) etc..to get the two numbers needed (startPixel,EndPixel) to make the optimization work. So to make this less stressful ive added a function to the DMT to do the maths for you :D. You dont have to run this every time you want to open the draws you just run it one time for each draw you have to find the magic numbers and then use them in your code -

StartPixel,EndPixel-Doubble click the DMT in windows(no commandline) to open up the 'Pre-Calc' tool then select a 'draw' (you will have to do this once for each draw, but not the main mask) image and the program will give you the start and end pixel numbers needed to speed the drawing process up.

CommandLine Syntax
So the DMT is multi-functional now it can be used 3 ways ;-

Standard Drawing Mode:- [ImgMain] [Method] [imgDraw]

Optimized Drawing mode:- [ImgMain] [Method] [imgDraw] [startpixel] [EndPixel]

DMT PreCalc Tool:
- Just double click DMT.exe in windows.
- Select Draw
- add the numbers to the end of the commandline.

Note: all filanames have to be 'short filenames' to avoid extra spaces in the commandline ;)

Sorry about the rapidshare download but the demo progs to big to upload here
http://rapidshare.com/files/94425349/DMT3.apz

This is the command line program on its own.


Mirrored this offering on amsuser.com:

http://www.amsuser.com/ams/examples/DMT-AMS7-clueless.rar

Thanks clueless.

clueless
02-24-2008, 11:30 PM
Thanks :yes