Well, imagine we have the following MS Word document:![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
The preview will look like this, with shadow: |
![]() |
<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")
set word=CreateObject("Word.Application")
'Opening the document read-only
word.Documents.Open "c:\mydoc.doc",False,True
set w_doc=word.ActiveDocument
'Size of shadow
shad=4
sizex=200
sizey=200
obj.CreateImage sizex+shad,sizey+shad,256
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
'Shadow Color
obj.SetColor 2,153,153,153
obj.SetBgColor 0
obj.SetDrawColor 1
'Clearing the image area
obj.FillRect 0,0,sizex-1,sizey-1
obj.CheckObject w_doc,x,y
if x>0 then
obj.DrawObject w_doc,"CONTENT",2,2,x*3/5,y*3/5
end if
'Drawing a bounding black rectangle
obj.CreateBrush "BS_NULL",2,""
obj.SetDrawColor 0
obj.Rectangle 1,1,sizex-2,sizey-2
obj.SetDrawColor 1
obj.Rectangle 0,0,sizex-1,sizey-1
obj.SetBgColor 0
obj.FillRect sizex,sizey+shad-1,sizex,sizey+shad
'Drawing a shadow
obj.SetBgColor 0
obj.FillRect sizex,0,sizex+shad-1,shad-1
obj.FillRect 0,sizey,shad-1,sizey+shad-1
obj.SetBgColor 2
obj.FillRect sizex,shad,sizex+shad-1,sizey+shad-1
obj.FillRect shad,sizey,sizex+shad-1,sizey+shad-1
obj.WebPalette
w_doc.Close False
word.Quit False
img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>
<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")
'Creating an object from document file
set w_doc=GetObject("c:\mydoc.doc")
'Size of shadow
shad=4
sizex=200
sizey=200
obj.CreateImage sizex+shad,sizey+shad,256
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
'Shadow Color
obj.SetColor 2,153,153,153
obj.SetBgColor 0
obj.SetDrawColor 1
'Clearing the image area
obj.FillRect 0,0,sizex-1,sizey-1
obj.CheckObject w_doc,x,y
if x>0 then
obj.DrawObject w_doc,"CONTENT",2,2,x*3/5,y*3/5
end if
'Drawing a bounding black rectangle
obj.CreateBrush "BS_NULL",2,""
obj.SetDrawColor 0
obj.Rectangle 1,1,sizex-2,sizey-2
obj.SetDrawColor 1
obj.Rectangle 0,0,sizex-1,sizey-1
obj.SetBgColor 0
obj.FillRect sizex,sizey+shad-1,sizex,sizey+shad
'Drawing a shadow
obj.SetBgColor 0
obj.FillRect sizex,0,sizex+shad-1,shad-1
obj.FillRect 0,sizey,shad-1,sizey+shad-1
obj.SetBgColor 2
obj.FillRect sizex,shad,sizex+shad-1,sizey+shad-1
obj.FillRect shad,sizey,sizex+shad-1,sizey+shad-1
obj.WebPalette
img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>
<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")
'Size of shadow
shad=4
sizex=200
sizey=200
obj.CreateImage sizex+shad,sizey+shad,256
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
'Shadow Color
obj.SetColor 2,153,153,153
obj.SetBgColor 0
obj.SetDrawColor 1
'Clearing the image area
obj.FillRect 0,0,sizex-1,sizey-1
obj.CheckObject "c:\mydoc.doc",x,y
if x>0 then
obj.DrawObject "c:\mydoc.doc","CONTENT",2,2,x*3/5,y*3/5
end if
'Drawing a bounding black rectangle
obj.CreateBrush "BS_NULL",2,""
obj.SetDrawColor 0
obj.Rectangle 1,1,sizex-2,sizey-2
obj.SetDrawColor 1
obj.Rectangle 0,0,sizex-1,sizey-1
obj.SetBgColor 0
obj.FillRect sizex,sizey+shad-1,sizex,sizey+shad
'Drawing a shadow
obj.SetBgColor 0
obj.FillRect sizex,0,sizex+shad-1,shad-1
obj.FillRect 0,sizey,shad-1,sizey+shad-1
obj.SetBgColor 2
obj.FillRect sizex,shad,sizex+shad-1,sizey+shad-1
obj.FillRect shad,sizey,sizex+shad-1,sizey+shad-1
obj.WebPalette
img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>