tblit.dll - Oliver, 2003

This dll copies a rectangular area out of a window and draws it
to another spot in the same window or a different window, transparently
over whatever graphical information residing there.
the transparency percentage is adjustable (even tho it is more a
dominance percentage, 0 being there wont be a trace of the image
and 100 equaling a normal .drawcopy, hence the original content
is completely covered.

what it does is... copying the 2 rectangular areas involved (original
pic at the end-position and the picture being copied), saves them
as bitmaps, dll does the maths on those 2 bitmaps, outputs them to
a new bitmap and the script can then (after success) .drawpic that one
and delete the bitmaps

i know this sounds rather clumsy and full of efforts for the CPU
and HD :P but i didnt find a better way to do it, mIRC doesnt really
like to give the picwin context free for change, so yeah.
the dll itself should run in 10-20ms if even, with 500x500 or so pixels
in the copied area, thats on my PII 350, the bitmap saving makes it a
lil slower, so i dont think this is useful for some realtime rendering

in case you dont want to use the snippet i gave down there (or will give,
since i havent written it yet), the dll awaits 3 arguments
[file1] [file2] [percentage], the first 2 obviously strings, last one an integer
it returns ERR:* on errors, like wrong parameters and OK:* if things
worked like they should.

if you try to use bitmaps with this manually, you must make sure the 2
bitmaps provided have the same dimensions and bitdepth (16, 24 or 32bit).
i also didnt put any check for paths with spaces into the parsing of the
arguments.. so "c:\mirc\my scripts\blob.bmp" will not be acceptable as "first
argument"...

however, i suggest you use the snippet (if you consider it useful
and use it at all ;P)

alias drawtransp {
  .window -phf @unlikely_window_name -1 -1 $7 $8
  .drawcopy $1 $2 $3 $7 $8 @unlikely_window_name 0 0
  .drawsave -b24 @unlikely_window_name tblittr1.bmp
  .drawcopy $4 $5 $6 $7 $8 @unlikely_window_name 0 0
  .drawsave -b24 @unlikely_window_name tblittr2.bmp
  .window -c @unlikely_window_name
  var %s = $dll($hget(ichess $+ %actboard,dll), tblit, tblittr1.bmp tblittr2.bmp $9)
  .drawpic $1 $2 $3 tblit.bmp
  .remove tblittr1.bmp
  .remove tblittr2.bmp
  .remove tblit.bmp
}

(add any error checking of %s yourself :P)

usage:

  .drawtransp @targetwindow x y @sourcewindow x y width height dominancepercentage

its very similar to .drawcopy at that

the output bitmapname is not variable, sorry.. and it creates those files
in the main mIRC folder, sorry about that as well... but no way to figure
out the $scriptdir in the dll, and allowing it as argument would also
cause some need to check for spaces and all

hope this will be of use.
