Frågan 8 apr. 2003 07:41 #1 nån som använder denna komponent?
jag får inte med hela texten när jag roterar.
Dim imageobj, fontobj, Heading, Width, Height
set imageobj = Server.CreateObject("W3Image.Image")
Heading = Request.QueryString("Heading")
imageobj.CreateEmptySurface 1,1
Set fontobj = imageobj.CreateFont("Arial", 20, 0, "bold", 0, &H00dbdbdb&, false, false, true)
imageobj.SetFont(fontobj)
Width = imageobj.GetTextWidth(Heading)
Height = imageobj.GetTextHeight(Heading)
imageobj.CreateEmptySurface Width,Height
imageobj.SetFont(fontobj)
imageobj.DrawText Heading, 0, 0
imageobj.Rotate 90, Width/2 , Height/2
imageobj.StreamImage Response, "JPG", 24
Engine^ Medlem sedan dec. 2000 3 887 inlägg Såg inga konstigheter när jag kollade på W3Image.Image , men jag skulle gissa på att ytan blir fel, när du tar ut Width och Hieght . Du kan ju testa en annan lösning:
Dim imageobj, drawArea, fontobj, Heading, Width, Height
Set imageobj = Server.CreateObject("W3Image.Image")
imageobj.CreateEmptySurface 1, 1
fontobj = imageobj.CreateFont("Arial", 20, 0, "bold", 0, &H00dbdbdb&, false, false, true)
imageobj.SetFont fontobj
Heading = Request.QueryString("Heading")
Width = imageobj.GetTextWidth(Heading)
Height = imageobj.GetTextHeight(Heading)
imageobj.Stretch Width, Height [blue]'Istället för en ny tom bild...[/blue]
imageobj.DrawText Heading, 0, 0
imageobj.Rotate 90, CInt(Width / 2), CInt(Height / 2)
imageobj.StreamImage Response, 'JPG', 24
Hittat en lösning! :)
Dim imageobj, drawArea, fontobj, Heading, Width, Height
Set imageobj = Server.CreateObject("W3Image.Image")
imageobj.CreateEmptySurface 200, 200
Set fontobj = imageobj.CreateFont("Arial", 20, 0, "bold", 0, &H00dbdbdb&, false, false, true)
imageobj.SetFont fontobj
Heading = Request.QueryString("Heading")
Width = imageobj.GetTextWidth(Heading)
Height = imageobj.GetTextHeight(Heading)
imageobj.DrawText Heading, 0, 0
imageobj.Rotate 90, 15,15
imageobj.crop 0,0,Height,Width
imageobj.StreamImage Response, "JPG", 24