|
#1
|
||||
|
||||
|
Example: Free tool : Dynamic Masking Tool
This tool is for mixing custom window masks dynamically. Its a command line tool written in visual basic 6 that takes the white elements from one bmp and then add/remove them from another bmp. This allows you make 'draws' that extend outwards from your main program window.
![]() Eventually ill be making this into a DLL file. Format: Add the white elements of MaskA into MaskB. MaskB is then re-saved Code:
DMT [Location of Draw Mask] [location of main custom mask] DMT [Location of Draw Mask] [location of main custom mask] [remove] Here's an example of how to set up the process in code; Code:
function CompositeMasks(DrawNumb)
---------------------------
------------ initialise local variables ----------------
local CheckFile = 0;
local FileSize = File.GetSize(_SourceFolder.."\\AutoPlay\\Mix\\CustomMask.bmp");
--------------------------------------
------------ Run tool and pass the command line ----------------
File.Run("AutoPlay\\Mix\\composite.exe", ConstructCommandLine(DrawNumb), "", SW_SHOWNORMAL, true); -- run composite tool with commandline pointing to the mix folder
-------------------------------------------------------------------
------------ Check for main file to change size then use it for windown mask ----------------
while CheckFile < 50 do -- check 50 times then give up -- Checks for a change in file size 50 times
if File.DoesExist("AutoPlay\\Mix\\CustomMask.bmp") and (File.GetSize("\\AutoPlay\\Mix\\CustomMask.bmp") ~= CheckFile) then -- File size check against value recorded before running the composite tool
Window.SetMask(Application.GetWndHandle(), "AutoPlay\\Mix\\CustomMask.bmp", true, 0); -- If the file has chaged size then set it as the new mask
break -- Dumps out of the 'while' loop
else
CheckFile = CheckFile + 1; -- Increments the counter
end
end
end
-----------------------------------------------------
-------------------------------------------------------------------------------.
------------ Set up the commandline -----------------------------
---------------------------------------------------
function ConstructCommandLine(DrawNumb)
local CommandLine = -1;
if DrawNumb == 1 then
CommandLine = _SourceFolder.."\\AutoPlay\\Images\\Left.bmp";
elseif DrawNumb == 2 then
CommandLine = _SourceFolder.."\\AutoPlay\\Images\\Bottom.bmp";
elseif DrawNumb == 3 then
CommandLine = _SourceFolder.."\\AutoPlay\\Images\\Right.bmp";
end
CommandLine = CommandLine .. "#"; -- Adding a space before adding the main mask location
CommandLine = CommandLine .. _SourceFolder.."\\AutoPlay\\Mix\\CustomMask.bmp"; -- Adding the location of the main Mask
-- Only checking for
if Draw[DrawNumb] == 1 then --
Draw[DrawNumb] = 0 -- Toggles draw open/close state
CommandLine = CommandLine .."#"; -- Adding a space
CommandLine = CommandLine .."remove"; -- Add the flag to remove white pixels (by adding black) rather than write them
else --
Draw[DrawNumb] = 1 -- Toggles draw open/close state
CommandLine = CommandLine .."#"; -- Adding a space
CommandLine = CommandLine .."Add"; -- Add the flag to add white pixels rather than remove them
end
return CommandLine
end
|
|
#2
|
||||
|
||||
|
This tool has now been uprated to version 2 : Download the DMT v2.0 Info
Last edited by clueless; 02-04-2008 at 12:47 PM. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Best way to share custom buttons with the group? | mwreyf1 | AutoPlay Media Studio 6.0 | 10 | 09-03-2009 05:01 AM |
| Free 3D Modeling tool | bnkrazy | General Chat | 2 | 04-27-2006 01:22 PM |
| Free online monitor calibration tool... | Corey | General Chat | 1 | 09-28-2005 08:07 AM |
| Cool (free) Audio Conversion Tool | AXXESS | General Chat | 8 | 02-09-2005 11:57 AM |
| Determining the Amount of Free Space on a Drive | Desmond | AutoPlay Media Studio 5.0 Examples | 0 | 10-03-2003 11:50 AM |
All times are GMT -6. The time now is 12:34 AM.









Linear Mode

