mmmm
mmmm

Reputation: 2471

Programmatically rotate tiff image (or pdf)

Does anyone know a way of rotating an image (jpg or gif) in a TWebBrowser control (using Delphi)

Update

The file would be local.

Update 2 So I guess the question should be how do I rotate an image or pdf.

Upvotes: 1

Views: 1194

Answers (3)

Jørn E. Angeltveit
Jørn E. Angeltveit

Reputation: 3079

I guess that you already use this approach to show the HTML content in your TWebBrowser.

Now, instead of JavaScript (as suggested by Robert), you use CSS in the generated HTML document.

I haven't tested this, but you should be able to rotate the image (and other HTML-elements) by using this CSS code (for IE-based browsers):

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

See details at MSDN

Upvotes: 1

Robert Love
Robert Love

Reputation: 12581

If you have control over the content return in the TWebBrowser it can be done via JavaScript.

Here is an example on JavaScript Image Rotation.

If you want to do it with a TImage there are several options listed in this Q/A.

Upvotes: 1

Daisetsu
Daisetsu

Reputation: 4976

Well if it's on a website (in the TWebBrowser) then you can't rotate it. The best you can do is if the image is on your website you can use PHP/ASP/etc. to load the image, and produce a rotated version of it.

Upvotes: 0

Related Questions