---
title: "rotera bild med dimac image"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/73506-rotera-bild-med-dimac-image"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "doggelito"
published: "2003-04-08T07:41:20.000Z"
updated: "2003-04-08T09:43:14.000Z"
replies: 2
views: 229
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/73506-rotera-bild-med-dimac-image"
---

# rotera bild med dimac image

## #1 — doggelito, 2003-04-08T07:41Z

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
```

Permalänk: https://www.webforum.nu/p/73506

## #2 — Engine^, 2003-04-08T08:20Z

Såg inga konstigheter när jag kollade på [W3Image.Image](http://dimac.net/?contentKey={A046E47B-5A71-41BC-8157-AE43445B6FC5}), 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
```

Permalänk: https://www.webforum.nu/p/1006033

## #3 — doggelito, 2003-04-08T09:43Z

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
```

Permalänk: https://www.webforum.nu/p/1006074

---

Tråden på webben: https://www.webforum.nu/amne/asp/73506-rotera-bild-med-dimac-image
