Script painting

Cole o código abaixo dentro da tag

<body>... COLE AQUI...</body>

Delete o comando <body> do código fonte default, para não ficar duplicado.

Siga as instruções inseridas, em letra amarela, no código abaixo:

<META http-equiv=Content-Type content="text/html; charset=x-user-defined"><!-- Enter Image width+10 for Margin-left below -->
<META content="MSHTML 5.50.4134.100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#cc9900>
<DIV id=paint
style="LEFT: 0px; VISIBILITY: hidden; POSITION: absolute; TOP: 0px">
<!--Troque o endereço em azul pelo endereço da imagem que deseja usar. --><STRONG><IMG id=pic1
style="Z-INDEX: -1; LEFT: 0px; POSITION: absolute; TOP: 0px"
src="
renoirgirlspiano.jpg" name=RENOIR> 

<!--Entre aspas, em azul, está o endereço do pincel. Substitua pelo endereço da figura do pincel em seu pc. Antes você deve salvar a imagem do pincel, que está no final desta página-->

<IMG id=pic2
style="Z-INDEX: 10; LEFT: 0px; VISIBILITY: hidden; WIDTH: 122px; POSITION: absolute; TOP: 0px; HEIGHT: 115px"
src="
paint.gif" name=PINCEL>
</STRONG>
<DIV>
<!-- A imagem seguinte é uma pequena gif branca.Salve-a, no final desta página e troque o endereço em azul, entre aspas, pelo endereço da gif branca.

The following image is a small white gif to mask the painting.
The image will be set to 20 pixels height and width by the script.
-->
<STRONG>

<IMG id=mask style="DISPLAY: none"
src="
white.gif">
<SCRIPT language=VBScript>
' by Edgar V. Poirier moomoo@nbnet.nb.ca  revised Jan 3, 1999
Dim w, brushTop, maskHeight, wdth, item1, count, line, myTimer, picWdth, numLines, h, res
Set w=document.body

' Initialize
sub setUp()
 ClearTimeOut(myTimer)
 line=0
 brushTop=0
 maskHeight=h
 numLines=h+1
 paint.style.visibility = "visible"
 count=0
 brushTop = count*20
 pic2.style.top = brushTop
 wdth=picWdth
 item1="m"&line
 eraseMask item1, wdth
end sub

' Paint left to right
' Erase the mask line 10 pixels at a time
sub eraseMask(item1, wdth)
 ClearTimeOut(myTimer)
 wdth=wdth-20
 pic2.style.visibility = "visible"
 if wdth>0 and line<numLines then
' Erase mask line.
  document.all(item1).style.width = wdth
  document.all(item1).style.left = picWdth-wdth
  pic2.style.left = picWdth-wdth
  myTimer=SetTimeOut("eraseMask item1, wdth",200)
 else
' Line erased. Last one done?
  if line<numLines then
' Not done removing mask lines so do next one.
   document.all(item1).style.visibility = "hidden"
   pic2.style.left = "10"
   line=line+1
   item1="m"&line
   count=count+1
   brushTop = count*20
   pic2.style.top = brushTop
   wdth=picWdth
   myTimer=SetTimeOut("eraseMask item1, wdth",500)
  else
' All done so hide brush and exit.
   pic2.style.visibility = "hidden"
  end if
 end if
end sub

' Everything starts here
sub Window_OnLoad()
' Get user screen resolution
 wx=window.screen.width
' and adjust font size.
 res=INT(wx/128)
 w.style.fontSize=14+res

<!-- As dimensões da imagem principal vc deve calcular aqui. A largura e altura devem ser adquadas ao script, até ficarem do tamanho desejado. Veja os valores abaixo, em azul-->
 picWdth=INT((pic1.width/
6)*res)
 pic1.style.posHeight=(pic1.height/
6)*res
 w.style.marginLeft=picWdth+10
' Set the number of mask lines
 h=INT(pic1.style.posHeight/20)
 if h*20<INT((pic1.style.posHeight/8*res))then h=h+1
' Create the mask images
 for i=0 to h
  data=data&"<IMG id='m"&i&"' src='"&mask.src&"' style='position:absolute;"
  data=data&"top:"&i*20&";left:0;"
  data=data&"height:20;width:"&picWdth&";z-index:1'>"
 next
 paint.insertAdjacentHTML "AfterBegin", data
      myTimer=SetTimeOut("setUp",1000)
end sub

</SCRIPT>


 

     


                Scripts de Sucesso             

                                

                                  design by Angela Maria Pereira Glavam

 

  Copyright © 2002 by Angela Maria P. Glavam® 

                                            Todos os direitos reservados