SetBkMode

The SetBkMode function sets the background mix mode. The background mix mode is used with text, hatched brushes, and pen styles that are not solid lines.

SetBkMode sBkMode

Parameters

sBkMode
String specifying the background mode. This parameter can be either of the following values:
StringMeaning
"OPAQUE" Background is filled with the current background color before the text, hatched brush, or pen is drawn.
"TRANSPARENT" Background remains untouched.

Remarks

The SetBkMode function affects the line styles for lines drawn using a pen created by the CreatePen function.

Example
View result

<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")

size=401
obj.CreateImage size,size,4
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
obj.SetColor 2,204,0,0
obj.SetColor 3,204,204,0
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1

obj.SetTextColor 2
obj.SetBgColor 1
obj.FillRect 50,50,size-51,size-51
obj.CreatePen "PS_SOLID",2,2
obj.CreateBrush "BS_HATCHED",3,"HS_DIAGCROSS"
obj.SetBkColor 0
obj.SetBkMode "OPAQUE"
obj.Rectangle 5,5,size/2,size/2
obj.TextOut 5,size/2+4,"OPAQUE"
obj.SetBkMode "TRANSPARENT"
obj.Rectangle size/2+1,size/2+1,size-6,size-6
obj.SetTextAlign "TA_RIGHT","TA_BOTTOM"
obj.TextOut size-6,size/2-4,"TRANSPARENT"

img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>