SetTransformation eM11,eM12,eM21,eM22,eDx,eDy
x' = x * eM11 + y * eM21 + eDx,
y' = x * eM12 + y * eM22 + eDy,
Operation | Meaning |
---|---|
Scaling | Horizontal scaling component |
Rotation | Cosine of rotation angle |
Reflection | Horizontal component |
Operation | Meaning |
---|---|
Shear | Horizontal proportionality constant |
Rotation | Sine of the rotation angle |
Operation | Meaning |
---|---|
Shear | Vertical proportionality constant |
Rotation | Negative sine of the rotation angle |
Operation | Meaning |
---|---|
Scaling | Vertical scaling component |
Rotation | Cosine of rotation angle |
Reflection | Vertical component |
eM11=1.0, eM12=0.0, eM21=0.0, eM22=1.0, eDx=0.0, eDy=0.0
The SetTransformation function will fail unless the graphics mode has been set to GM_ADVANCED by previously calling the SetGraphicsMode function. Likewise, it will not be possible to reset the graphics mode to the default GM_COMPATIBLE mode, unless the world transformation has first been reset to the default identity transformation by calling SetTransformation(1.0, 0.0, 0.0, 1.0, 0.0, 0.0).
You can not return to COMPATIBLE mode from ADVANCED, if you changed the default transformation settings. You should change settings to default first.
The following tabe shows how you should set every member for each operation:
Operation | xM11 | xM12 | xM21 | xM22 |
---|---|---|---|---|
Rotation | Cosine | Sine | Negative sine | Cosine |
Scaling | Horizontal scaling component | Zero | Zero | Vertical scaling component |
Shear | Zero | Horizontal Proportionality Constant | Vertical Proportionality Constant | Zero |
Reflection | Horizontal Reflection Component | Zero | Zero | Vertical Reflection Component |
<%@ Language=VBScript %>
<%
Response.ContentType="image/gif"
set obj=Server.CreateObject("shotgraph.image")
size=400
obj.CreateImage size,size,2
obj.SetColor 0,255,255,255
obj.SetColor 1,0,0,0
obj.SetBgColor 0
obj.FillRect 0,0,size-1,size-1
obj.SetDrawColor 1
obj.CreateBrush "BS_NULL",0,""
obj.SetGraphicsMode "GM_ADVANCED"
for i=0 to 179 step 10
ang=i*3.141/180.0
'Rotate the drawing
obj.SetTransformation Cos(ang),Sin(ang),-Sin(ang),Cos(ang),size/2,size/2
obj.Ellipse -size/2,-size/4,size/2-2,size/4-2
next
img=obj.GifImage(-1,1,"")
Response.BinaryWrite(img)
%>