473,698 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotate pictueres in html Document

Is it possible and how to rotate pictures in HTML document

Thank you,
Samuel
Feb 9 '07 #1
8 16807
Samuel Shulman wrote:
Is it possible and how to rotate pictures in HTML document

Thank you,
Samuel

In straight HTML -- no. In straight HTML+Javascript No.

IE has some CSS filters which may do this but it's propriatary to IE and
won't work in other browsers (And IE no longer commands a 90%+ market
share).

The only real way to do what you want is to use server side scripts to
rotate the image.

In PHP rotating an image is as simple as this.

http://somedomain.com/rotate.php?feed=image.jpg&rot=90

<?php
// File and rotation
$filename = $feed;
$degrees = $rot;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefrom jpeg($filename) ;

// Rotate
$rotate = imagerotate($so urce, $degrees, 0);

// Output
imagejpeg($rota te);
?>

--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
Feb 9 '07 #2
I was refering to the second option
Or even better that the page will change the images using a timer

Thank you,
Sam

"David Gillen" <Be****@RedBric k.DCU.IEwrote in message
news:sl******** ***********@mur phy.redbrick.dc u.ie...
Samuel Shulman said:
>Is it possible and how to rotate pictures in HTML document
Do you mean..
1) take an image and turn is clockwise/anitclockwise
2) each time the page loads select a different image in rotation?

D.
--
Fermat was right.

Feb 9 '07 #3
yes - you can do this-
Use the canvas tag. It is only supported I think in gecko based
browsers (Firefox and Safari, NOT IE). However Google has a free
little javascript library that will automatically convert any canvas
tags to use VRML in IE called excanvas. Very handy.

excanvas can be found at:
http://excanvas.sourceforge.net/

tutorial for the canvas tag:
http://developer.mozilla.org/en/docs/Canvas_tutorial

good luck!

Feb 9 '07 #4
Walton wrote:
excanvas can be found at:
http://excanvas.sourceforge.net/
Is this *definitely* from Google? It seems a little fishy to be
perfectly honest. Questions that come to mind include, why didn't Google
host it at http://code.google.com? Also, why is the logo on the top-left
of the page different to the usual Google Code logo?

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Feb 9 '07 #5
Is this *definitely* from Google? It seems a little fishy to be
perfectly honest. Questions that come to mind include, why didn't Google
host it athttp://code.google.com ?Also, why is the logo on the top-left
of the page different to the usual Google Code logo?
Yes, I'm fairly certain it's from Google. It's on sourceforge because
it's open source. Not sure why logos are different.

Nothing to be fishy about. The code actually works, just a bit slower
than canvas.

this page will show you how to checkout the latest code:
http://code.google.com/p/explorercanvas/source

that has the more familiar google code logo on it.

Feb 9 '07 #6
Walton wrote:
Yes, I'm fairly certain it's from Google. It's on sourceforge because
it's open source. Not sure why logos are different.
[...]

Ah okay, as long as you're sure ;) The other link you posted helps me to
make my mind up about it being "okay" though.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Feb 9 '07 #7
David Gillen wrote:
Samuel Shulman said:
>>I was refering to the second option
Or even better that the page will change the images using a timer

Please don't top post.
For changing what image is displayed each time a page is loaded you need to do
it server side, with php or asp or some such scripting language.
JS is client side and can't do this.
Yes, it can:

imgs=["a.gif","b.gif" ,"c.gif"]
document.write( "<IMG SRC= '"+imgs[new Date()%imgs.len gth]+"' >")

Mick
>
Although JS could be used to flick through images via a timer mechanism.
Look at set time out and then have it turn div's with the images on and off.

D.
Feb 9 '07 #8
In comp.lang.javas cript message <0p************ *****@newsfe2-win.ntli.ne
t>, Fri, 9 Feb 2007 14:18:36, Samuel Shulman
<sa************ @ntlworld.compo sted:
>I was refering to the second option
Or even better that the page will change the images using a timer
>"David Gillen" <Be****@RedBric k.DCU.IEwrote in message
news:sl******* ************@mu rphy.redbrick.d cu.ie...
>2) each time the page loads select a different image in rotation?
Don't top-post. Don't over-quote. See FAQ.

Unless you have a near-infinite number of images available, I don't
think you can *change* the image at *every* load by using new Date().

For any one computer, ISTM that, using a cookie, you should be able at
each load to choose at random from the available images excluding that
last shown, thereby ensuring a *change*.

A page can easily change its own images at intervals while running; see
the graphics clocks in <URL:http://www.merlyn.demo n.co.uk/js-anclk.htm>.

It's a good idea to read the newsgroup and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 IE 6
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Feb 10 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2757
by: mike | last post by:
regards: Is it possible to use java XML api to translate a HTML document into a XHTML document(mobile profile) thank you best wishes
1
1542
by: mike | last post by:
regards: A HTML document can be converted to XHTML document. one step is:'Un-minimize' minimized attributes What does the step mean in easy english?...@@. I mean what operations I should do on the attributes? Any suggestion is welcome.
0
1746
by: purespam | last post by:
How can I dynamically add file links to a html document? I need to be able to click an image icon and the "Open file" box should pop up where I can select a document from my harddisk. The document should then be added to the html file at a specific spot and the file reloaded with the new document added to the html file showing. This new document should be stored in its new form. Is this possible? Or is it too hard to find the spot in...
6
3238
by: vandalo | last post by:
Hi all I developed a service which can convert an office document (word, excel, powerpoint into HTML and save it on the file system To do this I use the "save as" functions of the office applications Word, Excel and PPT create a folder which contains all the support files for the document My ASP.NET application should then get the HTML document (load it from the disk) and render it into the browser I don't have problems with Word and...
2
4593
by: csgraham74 | last post by:
Hi, I have a requirement in work that i give a person the ability to create a html document using a richt text editor. What i then want to do is save the HTML doct to my server & insert reference in a database so that i can retrieve the html document. Basically i dont have a clue how to convert a string in HTML format (taken from the RTE) to an actual document and then save it to a folder. Can anyone point me in the correct direction.
9
9679
by: Rob | last post by:
I'm writing an application without a user interface and I have a requirement to find the plain ASCII text between <Ptags in an HTML document which happens to have been obtained via POP3 and parsed out of a MIME message body. If I had a user interface, I could drop and IE web control onto a form, load the HTML into that and then use the document parser. I've always hated that route as it's so clunky and anyway, this app doesn't have a...
3
6354
by: SMH | last post by:
Normally an SVG document is loaded/parsed/interpreted inside an HTML document using an 'object' (or 'embed') element, although there are supposedly other ways too. The problem is, the SVG document must be static this way. I want to use the DOM interface to build SVG dynamically inside an HTML document. I am guessing I can build it inside HTML within an 'object' (or maybe 'iframe'?) element. My intentions/goals:
9
3468
by: jd | last post by:
I am looking for python code (working or sample code) that can take an html document created by Microsoft Word and clean it up (if you've never had to look at a Word-generated html document, consider yourself lucky ;-) Alternatively, if you know of a non-python solution, I'd like to hear about it. Thanks... -- jeff
11
5123
Dormilich
by: Dormilich | last post by:
Lately I have seen so much awful HTML, that I like to show what a HTML document should look like, regarding the requirements from the W3C. the absolute minimum is defined as: or expressed in code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <TITLE>My first HTML document</TITLE>
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4361
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.