Flip and rotation on an Image

Hello,
I would like to perform flip and +/-90� rotation on an image but after a rotation, the flip is performed in the wrong direction my code looks like this :
/*axis at the center of image*/
g2D.translate(width/2,height/2);
g2D.scale(-1,1);
g2D.rotate(Math.PI);
/*image orientation correction*/   
g2D.scale(1,-1);
/*rotation and flip*/     
g2D.rotate(flipHorizontal*flipVectical*Math.toRadians(angle));
g2D.scale(flipHorizontal,flipVectical); //1 or -1
/* drawing the image */   
g2D.drawImage(imageToDraw, centreToX,centreToY, null);
// than positioning the axis back to origine I've tried to say that if the image as already been rotated then invert the flips, but in that case, after one flip the rotation is performed in the wrong direction...
Does anybody know how to solve this problem???
Thank you in advance.

i have to rotate, flip & scale an image , but it get misplaced when rotated on 90 and -90 please help me public void putImage_buffer(String s,int x,int y,int width,int height,double rotation,int xScale,int yScale,boolean hFlip,boolean vFlip) {
          int Rwidth=width;
          int Rheight=height;
                try{
ImageInputStream imageInput = ImageIO.createImageInputStream(new FileInputStream(filename));
            it = ImageIO.getImageReaders(imageInput);
            reader = (ImageReader) it.next();
            reader.setInput(imageInput);
            objBufimage=reader.read(0);
}catch(Exception e){System.out.println(e);}
          System.out.println("width : height! ratation"+width+" : "+height+"  : "+rotation);
        if(width==0&&height==0){
            offscreen.drawImage(objBufimage,0,0, null);      
         else{
               if(!(vFlip||hFlip)){
                    if(rotation==90)
                         Rwidth=height;
                         Rheight=width;
                         System.out.println("!(vFlip||hFlip) 90");
                    if(rotation==-90 )
                         rotation=270;
                         System.out.println(" -90 !(vFlip||hFlip");
                         Rwidth=height;
                         Rheight=width;
               if(vFlip )
                    if(rotation==90)
                         hFlip=!hFlip;
                         vFlip=!vFlip;
                         //Rwidth=height;
                         //Rheight=width;
                         System.out.println("width : height 90 vFlip");
                    if(rotation==-90)
                         hFlip=!hFlip;
                         vFlip=!vFlip;
                         //Rwidth=height;
                         //Rheight=width;
                         rotation = 270;
                         System.out.println("width : height -90 vFlip");
                    if(rotation==180)
                         System.out.println("width : height 180 vFlip");
               else if(hFlip )
                    if(rotation==90)
                         hFlip=!hFlip;
                         vFlip=!vFlip;
                         System.out.println("width : height 90 hFlip");
                         //Rwidth=height;
                         //Rheight=width;
                    if(rotation==-90)
                    {     rotation=270;
                         hFlip=!hFlip;
                         vFlip=!vFlip;
                         Rwidth=height;
                         Rheight=width;
                    if(rotation==180)
                         System.out.println("width : height 180 hFlip");
               if(vFlip && hFlip)
                    if(rotation==90)
                         System.out.println("width : height 180 hFlip&&vFlip 90");
                    if(rotation==-90)
                         rotation=270;
                         System.out.println("width : height 180 hFlip&&vFlip -90");
            AffineTransform tx = new AffineTransform();
            AffineTransform origTransform = offscreen.getTransform();
               System.out.println("hFlip:vFlip Math.PI "+hFlip+" : "+vFlip);
               rotation=rotation*(hFlip?-1:1)*(vFlip?-1:1);
               rotation = Math.toRadians( rotation );
               AffineTransform rotate=AffineTransform.getRotateInstance(rotation, Rwidth/2d, Rheight/2d);
               AffineTransform moveToImageCenter=AffineTransform.getTranslateInstance(Rwidth/2d, Rheight/2d);
               moveToImageCenter.concatenate(AffineTransform.getScaleInstance(hFlip?-1:1,vFlip?-1:1));
               moveToImageCenter.concatenate(AffineTransform.getTranslateInstance(Rwidth/-2d, Rheight/-2d));
               AffineTransform flip=moveToImageCenter;
               AffineTransform transformer = AffineTransform.getTranslateInstance(x,y);
               offscreen.setTransform(transformer);
                              offscreen.transform(rotate);
               offscreen.transform(flip);
               offscreen.drawImage(objBufimage,0,0,Rheight,Rwidth,null);
               //offscreen.drawImage(objBufimage.getScaledInstance(width,height,objBufimage.SCALE_DEFAULT),0,0,width,height, null);
               offscreen.setTransform( origTransform );
     }i get vFlip if hFlip+90or-90 and i get hFlip if vflip +90-90 means if actual flipping is vflip+90/-90 my method parameter gets hFlip +/-90 thats by i'm changing values

Similar Messages

  • Scale and rotate a tiff image

    How do you scale and rotate a tiff image without running out of memory?
    I have been trying to scale the image and rotate it before i pass it to the DisplayJAI but i keep running out of memory.
    code i use to rotate the image.
    private Image rotateImage(boolean rotateRight)
    Image img = imageHolder.getInUseImageIcon().getImage();
    Image rot = null;
    int imageWidth = imageHolder.getInUseImageIcon().getIconWidth();
    int imageHeight = imageHolder.getInUseImageIcon().getIconHeight();
    int buffer[] = new int[imageWidth * imageHeight];
    int rotate[] = new int[imageWidth * imageHeight];
    try
    MediaTracker tracker = new MediaTracker (this);
    tracker.addImage (img, 0);
    tracker.waitForAll();
    PixelGrabber grabber = new PixelGrabber(img, 0, 0, imageWidth, imageHeight, buffer, 0, imageWidth);
    try {
    grabber.grabPixels();
    catch(InterruptedException e) {
    e.printStackTrace();
    if(rotateRight)
    for(int x = 0; x < imageWidth; x++)
    for(int y = 0; y < imageHeight; y++)
    rotate[(x*imageHeight)+y] = buffer[((imageHeight-y-1)*imageWidth)+x];
    else
    for(int y = 0; y < imageHeight; y++)
    for(int x = 0; x < imageWidth; x++)
    buffer[(y*imageWidth)+x] = rotate[((imageWidth-x-1)*imageHeight)+y];
    for(int y = 0; y < imageHeight; y++)
    for(int x = 0; x < imageWidth; x++)
    rotate[((imageWidth-x-1)*imageHeight)+y] = buffer[(y*imageWidth)+x];
    rot = createImage(new MemoryImageSource(imageHeight, imageWidth, rotate, 0, imageHeight));
    catch (Exception e)
    e.printStackTrace();
    return rot;
    this is the code i use to scaled the image.
    Image scaled = originalImage.getImage().getScaledInstance(
    (int)(currentWidth * 1.5),
    (int)(currentHeight * 1.5),
    Image.SCALE_FAST);
    I tried this method, it works and does what i want but the scrolling and loading is too slow.
    public void paintComponent(Graphics g)
    Graphics2D g2D = (Graphics2D)g;
    g2D.rotate(Math.PI/2, (int)dimension.getWidth()/2, (int)dimension.getHeight()/2);
    g2D.drawImage(image, 0,0,(int)dimension.getWidth(), (int)dimension.getHeight(), this);
    Help plss.

    Nvm got the answer :)

  • Size and rotate a background image

    I would like to have a background image that rotates different images when the page is refreshed and sizes with my page. I believe I have a handle on the sizing part but I can't figure out how to make the images rotate. I would like the images to go in a particular order instead of random if that's possible.
    This is what I have so far:
    <head>
    <title>Stretched Background Image</title>
    <style type="text/css">
    /* Remove margins from the 'html' and 'body' tags, and ensure the page takes up full screen height */
    html, body {height:100%; margin:0; padding:0;}
    /* Set the position and dimensions of the background image. */
    #page-background {position:fixed; top:0; left:0; width:100%;;}
    /* Specify the position and layering for the content that needs to appear in front of the background image. Must have a higher z-index value than the background image. Also add some padding to compensate for removing the margin from the 'html' and 'body' tags. */
    #navbar {position:relative; z-index:1; padding:10px;}
    #content {position:relative; z-index:2; padding:10px;}
    </style>
    <!-- The above code doesn't work in Internet Explorer 6. To address this, we use a conditional comment to specify an alternative style sheet for IE 6 -->
    <!--[if IE 6]>
    <style type="text/css">
    html {overflow-y:hidden;}
    body {overflow-y:auto;}
    #page-background {position:absolute; z-index:-1;}
    #content {position:static;padding:10px;}
    </style>
    <![endif]-->
    </head>
    <body>
    <div id="page-background"><img src="stretchPix2.jpg" width="100%" alt="Smile"></div>
    <div id="navbar">
    <h2><img src="TestNavArt.gif" width="900" height="30"></h2>
    </div>
    <div id="content"><font color="#FFFFFF"> more test here?</font></div>
    </body>
    </html>
    If anyone can give me some insight into making the background image rotate I would greatly appreciate it.
    Thanks,
    Dave

    Hi
    The only reliable way to rotate a background image is using css3 but as this feature is only implemented in 1 browser, (and that is in beta)? There are a few javascript frameworks that claim to do this, but in testing I have not found one that is even 50% reliable.
    PZ

  • JS CS3 flag duplicate images with scale and rotation differnce

    I've been trying to cut down on the number of images a script I have would produce.  The old script would look for links that are being used multiple times and then just version the link which is fine.  What I am finding this that although a document may have one image linked 9 time 6 times out of the nine the image is scaled and rotated the same amount and the other 3 times the rotation and scaling also match. In this example the image only needs 2 versions the first as the original and the second with the scale and rotation of the image used 3 time let say.
    So to the code:
    The following code will work through the doc and create an array of the links as duplicates:
    function LinkUsage(myLink) {
        var myLinkCounter = 0;
            for (var myCounter =  0; myCounter < myDoc.links.length; myCounter++) {
            if (myLink.filePath == myDoc.links[myCounter].filePath) {
                myLinkCounter++;
        return myLinkCounter
    var myDoc = app.activeDocument;var myNumLinks = [];
    for ( var t = myDoc.links.length-1; t >= 0; t-- ){
        if(LinkUsage(myDoc.links[t])>1){
                myNumLinks.push(myDoc.links[t].id);
    Is there a way to loop through the array and only flag the differnent scale and roatations.  What I should get is that out of the multiple link uasage the image is only changed twice out of the 9 times used.
    I was trying to loop through the array and then loop through it within the loop to compare the link but this does not work for obvious reasons.
    for (var i=0  ; i <myNumLinks.length; i++){
        var valLink = myDoc.links.itemByID( myNumLinks[i]);
            if(valLink.parent.constructor.name == "Image"){
                for (var j=0  ; j<myNumLinks.length; j++){
                    if(myDoc.links.itemByID( myNumLinks[j]).parent.constructor.name == "Image"){
                        if(valLink.parent.parent.images[0].rotationAngle != myDoc.links.itemByID( myNumLinks[j]).parent.parent.images[0].rotationAngle){
                            $.write(myNumLinks[i]+"\n");
    Is what I am trying to do possible and if so any suggestions would be appreciated.
    Cheers, John.

    I think I might be one step closer to getting this to work.  I've been able to just capture the file path of the duplicates using:
    //count the number of times the link is used
    function LinkUsage(myLink) {
        var myLinkCounter = 0;
            for (var myCounter =  0; myCounter < myDoc.links.length; myCounter++) {
            if (myLink.filePath == myDoc.links[myCounter].filePath) {
                myLinkCounter++;
        return myLinkCounter
    //check if the filepath has been added to the array
    function chkVal(val){
        var compCount = 0;
        for(var arr =  0; arr < myNumLinks.length; arr++){
            if(val == myNumLinks[arr] ){
            compCount++;
        if(compCount >=1){
            return false;
            }else{
                return true;
    //check the links inthe doc
    var myDoc = app.activeDocument;
    var myNumLinks = [];
    for ( var t = myDoc.links.length-1; t >= 0; t-- ){
        if(LinkUsage(myDoc.links[t])>1){
            if(myNumLinks == 0){
                myNumLinks.push(myDoc.links[t].filePath);
                }else{
                    if(chkVal(myDoc.links[t].filePath)){
                        myNumLinks.push(myDoc.links[t].filePath);
    for (var i=0  ; i <myNumLinks.length; i++){
        $.write(myNumLinks[i]+"\n");

  • Animation in illustrator cs4: pan & rotate across large image while animating text?

    Hi there -
    I have a fairly large circular starmap image - it's a fantasy piece simulating an ancient painted star map with stars, ancient constellation figures, and calligraphic text. Basically a bitmap background from PShop, vector layers with stars, constellations and text. I want to export from Illustrator to Flash a number of short 'movies' of different views of this artwork panning from one point to another with possible zoom and rotation around the image as it pans. I also want to animate one or more of the constellation shapes as the movie pans, as well as adding momentary effects to some of the text.
    I'm familiar with setting up a non-panning animation in illustrator using layers as animation 'cells' and exporting to Flash. But is it possible to do this while moving across a large piece of artwork? How can I capture and export a specific 'view' which moves across the larger image and/or zooms in or out, while also animating a shape or text glow for example? Would this be accomplished with a mask set to the aspect ratio of the final movie which is moved/resized/rotated from layer to layer?
    Is this even possible in Illustrator CS4? I'm not familiar with Premier or AE, hoping to stay within Illy and Flash.
    Thanks!

    Thanks Monica,
    After researching, it looks like Sony Vegas can be used to create a freeflowing video 'fly-over' of the artwork. And then at specific points I can import and animate the Illustrator vector pieces with After Effects - just a 'bit' of a learning curve now...

  • How to undo cropped and rotated RAW images in ACR

    Can someone advise on returning to the original RAW image after the image has been edited in ACR.
    "Reset Camera Raw Defaults" seems to do everything but undo crops and image rotation.
    How do I undo these and/or return to the original unedited image?
    Many thanks

    Thanks but how exactly do I find the unedited CR2 within PSE/ACR?
    Everytime I open the file in PSE or ACR the edited version comes up and the most original version I can return to is to reset the Defaults.  However, this does not reverse crops and rotations
    I have noticed that the original CR2 file is viewable within MS Explorer but I'm reluctant to delete the .xmp as I don't want to loose keywords etc associated with the image.
    Many thanks for any suggestions

  • Multiplying image to coordinates and rotation

    Hi,
    I was wondering if anyone could help me write a Adobe Illustrator script.
    The script must be able to:
    1. Read a file containing several coordinates (X,Y) and angles.
    2. Select an image (or load an image).
    3. Copy and paste an image to the coordinates and rotate the images by the given angles.
    4. Repeat pasting/rotating until all coordinates are pasted with images.
    The result should be something like the image attached below.
    Can this be possible with an illustrator script?
    Could anyone guide me how I should approach this?
    Could you recommend any online references on programming an illustrator script?
    I don't always have access to Illustrator.
    Many thanks in advance,
    Anthony

    Hi Carlos,
    I have a bit of programming background. I'm familiar with VB, C, C++. I'm a novice on illustrator.
    I attempted at writing quick "copy, paste & rotate" script in javascript, see below. But I need to somehow get the coordinates from another file (a text file).
    Can I use something like this on the Illustrator script?
    http://www.javapractices.com/topic/TopicAction.do?Id=42
    var selectedObjects = app.activeDocument.selection; var topObject = app.activeDocument.selection[0];
    var msgType = "";
    if (app.documents.length>0)
         myselection = app.activeDocument.selection;
         if (myselection.length>0)
    for (var i=0; i<myselection.length; i++) {
         myselection[i].duplicate()
         myselection[i].translate(200,0)
         myselection[i].rotate(13)
         myselection[i].duplicate()
         myselection[i].translate(300,50)
         myselection[i].rotate(50)
         myselection[i].duplicate()
         myselection[i].translate(600,10)
         myselection[i].rotate(45)

  • How to rotate a thumbnail image in Finder?

    Is there a way to rotate a thumbnail image in Finder? When I click a photo in a Finder folder, the image automatically opens in Preview and the image is correctly displayed right side up. But the thumbnail image is displaying a vertical photo horizontally. Can I rotate the thumbnail?

    corelle,
    please open the sidebar of the Preview window and check how the thumbnail is displayed there.
    If the orientation is wrong in the Preview sidebar as well, then apparently some program rotated the image but not the EXIF preview image, which is obviously not a good thing.
    If the orientation is correct in the Preview sidebar, but wrong in the Finder, then the file probably has a custom icon with wrong orientation. This should then be removed rather than rotated. It's useless anyhow because Snow Leopard's Finder can better use the EXIF preview image instead.

  • How separate and rotate pieces of an object in preparation for creation of a GIF in After Affects?

    Here is the image that I'm working with...
    I want to make this object rotate a tight 90 degrees in After Effects and then separate. If you're wondering why I put this up under Photoshop it is because I need to have this model in addition to 2 others, one of the top half and one of the bottom half and button, both turned 90 degrees [preferably clockwise] in order to create the GIF. I need these 3 pieces before I can even consider creating the GIF in After Effects... so if somebody either wants to try and do it for me or to try and help me to do it on my own, either one would be extremely helpful

    Don't worry guys, I actually found the answer all on my own what I needed was to separate the image into 3 files, something I was probably going to do anyways to make exporting and importing the images easier and rotating the two top and bottom half images here's what I have right now (per background removal)Thanks for trying to help... but I think I'm ready to move on to After effects with this one The reason I'm moving it to after effects is simply because I understand simple movement/animation there already... if you're curious as to what I plan on doing with these images, the complete ball will sit in a hole in my border, turn a sharp 90 degrees right and then be replaced by the two half images, the bottom one will fade slowly out while the top is lifted off screen to the right... it's a fancy reveal for my upcoming project thanks again

  • IBooks Author Scale and Rotate in preview

    I just started with iBooks Author. I made a simple book with several chapters and pages. When previewing the book in the iPad the pages zoom and rotate with a two finger gesture. Then snap bak to the default scale and rotation. Imagine trying to pinch to zoom, but having the page scale.
    How can make the pages use the standard zooming behavior with out rotating and hold the zoom without snapping back to the initial scle?

    Sorry about that. I haven't used that software before, but they appeared to fit the bill according to their descriptions.
    There is another program, Image Tricks, that is for Tiger and it will let you rotate images and save the changes.
    http://www.belightsoft.com/products/imagetricks/overview.php
    I can't find any hacks for Preview that will let you do what you want.
    PowerMac G5   Mac OS X (10.4.6)   1GB RAM, nvidia 6800 ultra, Apple 30" Cinema Display

  • BitmapData Resize and rotation

    Hi there,
    I'm having some problems manipulating an image with AS3 and Flash Player 10.
    I've managed to edit a Bitmap from a local image by changing it's size and rotation with the help of class Matrix.
    The problem is that now I want to save the new image to the disk as a PNG file.
    I'm using a PNG as encoder that requires a BitmaData.
    When I passed that Bitmap.bitmapData all of the matrix changes do not get reflected in the bitmapData.
    Here is the code:
    var BMP:Bitmap  = Bitmap (LOADERINFO.content);
          BMP.pixelSnapping = PixelSnapping.ALWAYS;
          BMP.smoothing     = true;
          BMP.bitmapData.lock ();
    var scale:Number = .2;
    var matrix:Matrix = BMP.transform.matrix;
          matrix.rotate(90*(Math.PI/180));
          matrix.scale (scale,scale);
         BMP.transform.matrix = matrix;
    var BMPD:BitmapData = new BitmapData ( BMP.width, BMP.height, true, 0x00000000 );
          BMPD.draw(BMP);
    var BMP2:Bitmap = new Bitmap ( BMPD, PixelSnapping.ALWAYS, true );
    // JUST TO TEST
    addChild (BMP);
    addChild (BMP2);
    Thanks,
    PM

    oops, typo:
    kglad wrote:
    try:
    var BMP:Bitmap  = Bitmap (LOADERINFO.content);
          BMP.pixelSnapping = PixelSnapping.ALWAYS;
          BMP.smoothing     = true;
          BMP.bitmapData.lock ();
    var scale:Number = .2;
    var matrix:Matrix = BMP.transform.matrix;
          matrix.rotate(90*(Math.PI/180));
          matrix.scale (scale,scale);
         BMP.transform.matrix = matrix;
    var BMPD:BitmapData = new BitmapData ( BMP.width, BMP.height, true, 0x00000000 );
          BMPD.draw(BMP,matrix);
    var BMP2:Bitmap= new Bitmap(BMPD);
    // JUST TO TEST
    addChild (BMP);
    addChild (BMP2);

  • Rotate part of image

    Hi,
    Total newbie here, so apologies for if this is very basic. How do I select and rotate by degrees part of an image and not just the image as a whole? Many thanks in advance. Ciaran

    Hi Ciaran,
    With your image open, you could use any of the selection tools to make a selection and then rotate that selection only.
    1. I chose the Elliptical marquee tool and dragged a circular selection onto my image.
    2. When you have your active selection (with the little marching ants), switch to your Move tool (basic black arrow), be sure that you have Show Transform Controls checked in the top menu. This will show you the small, square handles around your selection so that you can rotate it.
    3. Position your cursor around one of the corner handles until you see bent arrow, click and rotate the selection!

  • Controlled rotation of an image

    Hello all
    Is there any way in FCP to control the rotation of an image.
    The project I'm currently working on requires me to rotate a photoshop image continuously. The image is of a pattern that has a hole cut out in the middle. The hole will allow the layers under need it to show through.
    I need the graphic to spin at about 1 turn every 2 seconds throughout the duration of the movie.
    Does anyone know of a simple method of doing this or do I need to start buying filters.
    I look forward to hearing from someone soon.

    This is easily achieved in the Motion tab on the Viewer window.... simply add a key frame at your start point, move the playhead forward to however many seconds the clip last, then enter a value of X x 360 (where X is the number of seconds the clip last, divided by 2), and a key frame will add automatically.
    ie - your graphic clip last 10 seconds
    put the playhead at the start and add a keyframe on 'Rotation' (in the Motion tab)
    move the playhead forward to the end (10 seconds)
    10 divided by 2 is 5, 5 x 360 =1800
    put 1800 as a value in the Rotation setting.
    job done.

  • 3D Rotation Slider for image sequence

    I created a 3d model rotated it 360 degrees and exported it an image sequence. I would like to be able import the sequence in flash and rotate the image sequence 360 degrees by creating and dragging a slider.

    What part of what you want to do are you having a problem with?
    If you create a new movieclip symbol and try to import one of the images onto the stage while inside of it, then if the images are named as a sequence Flash should be able to detect this and ask if you want to import the whole sequence.  If you select yes then it will place the sequence along the timeline of your movieclip.
    For the the Slider, just bring one in from the components library and set it up such that its range and increments match the frames occupied by the images.

  • Rotating Linked Km Images

    Hi guru's,
    I want to implement image rotation functionality in Enterprise portal
    Note : Images are stored in KM Repository, on click of each image, it should take to different URL .
    Thanks in advance
    Regards
    Sadik

    Hi Sadik,
    Here's some code that I wrote a whiles ago, perhaps it'll help you.
    import java.util.Enumeration;
    import java.util.Vector;
    import com.sapportals.htmlb.Form;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    * Created on 20/06/2005
    * Re-usable iView for displaying rotating graphical icons as links.
    * Images are displayed one at a time and fade into each other.
    * Uses iView parameters to allow the portal content admin to define the images,
    *  links and tooltips at iView creation time.
    * I've decided to allow a maximum of 12 icon/links, this can easily be updated at
    *  any time if required. Just make sure that the value of the constant 'maxIcons' is
    *  equal to the number of parameter sets you have in portalapp.xml
    * The parameter set for each icon/link should consist of the icon, link and tooltip
    *  parameters for that icon/link.
    public class RotatingIconLinks_Parameters extends PageProcessorComponent{
         public DynPage getPage(){
              return new IconLinksDynPage();
         }// End Constructor
         public class IconLinksDynPage extends DynPage{
              private static final int maxIcons = 12;
              private String icon = "";
              private String link = "";
              private String tooltip = "";
              private Vector iconLinks = new Vector();
              private IconInfo myIcon;
               * Initialization code.
               * We read all of the iView properties related to the icon/links and build
               *  a Vector containing this data for each icon/link.
              public void doInitialization(){
                   IPortalComponentRequest req = (IPortalComponentRequest)this.getRequest();
                   IPortalComponentProfile profile = req.getComponentContext().getProfile();
                   for(int i=1; i<=maxIcons; i++){
                        icon = profile.getProperty("Icon "+i);
                        link = profile.getProperty("Link "+i);
                        if(icon!=null && icon.length()>0 && link!=null && link.length()>0){
                             myIcon = new IconInfo(icon, link, profile.getProperty("Tooltip "+i));
                             iconLinks.add(myIcon);
              }// End Method doInitialization
               * Input handling code.
              public void doProcessAfterInput() throws PageException{
              }// End Method doProcessAfterInput
               * Create output. Called once per request.
              public void doProcessBeforeOutput() throws PageException{
                   Form myForm = this.getForm();
                   myForm.addRawText("" +
                        "<script language="javascript">" +
                             "var curr_item_index = -1;" +
                             "function HandleTimeout( ){" +
                                  "if (curr_item_index != -1 ){" +
                                       "document.all["item" + curr_item_index].style.display = "none";" +
                                  "}" +
                                  "curr_item_index = (curr_item_index + 1) % max_docs;" +
                                  "document.all["item_image" + curr_item_index].style.visibility="hidden";" +
                                  "document.all["item" + curr_item_index].style.display = "";" +
                                  "FadeIn( document.all["item_image" + curr_item_index] );" +
                                  "window.setTimeout( "HandleTimeout()", 2500, "javascript" );" +
                             "}" +
                             "function FadeIn( obj )" +
                                  "{obj.filters[0].Apply();" +
                                  "obj.style.visibility = "visible";" +
                                  "obj.filters.revealTrans.transition=12;" +
                                  "obj.filters[0].Play();" +
                             "}" +
                        "</script>");
                   myForm.addRawText("<table border=0 cellpadding=2 cellspacing=0 width="100%" dir="rtl" >");
                   Enumeration enum = iconLinks.elements();
                   int i = 0;
                   while(enum.hasMoreElements()){
                        myIcon = (IconInfo)enum.nextElement();
                        renderIconLink(myIcon, myForm, i);
                        i++;
                   myForm.addRawText("" +
                        "</table>" +
                        "<script language="javascript" >" +
                             "var max_docs = " + i + ";" +
                        "</script>" +
                        "</table>" +
                        "<script language="javascript" type="text/javascript">" +
                             "HandleTimeout();" +
                        "</script>");
              }// End Method doProcessBeforeOutput
              private void test(){
                   Form myForm = this.getForm();
                   myForm.addRawText("" +
                        "<script language="javascript">var curr_item_index = -1;function HandleTimeout( ){if (curr_item_index != -1 ) {" +
                        "document.all["item" + curr_item_index].style.display = "none";}" +
                        "curr_item_index = (curr_item_index + 1) % max_docs;" +
                        "document.all["item_image" + curr_item_index].style.visibility="hidden";" +
                        "document.all["item" + curr_item_index].style.display = "";" +
                        "FadeIn( document.all["item_image" + curr_item_index] );" +
                        "window.setTimeout( "HandleTimeout()", 2500, "javascript" );}" +
                        "function FadeIn( obj ){obj.filters[0].Apply();obj.style.visibility = "visible";obj.filters.revealTrans.transition=12;obj.filters[0].Play();}" +
                        "</script>" +
                        "<table border=0 cellpadding=2 cellspacing=0 width="100%" dir="rtl" >" +
                        "<tbody id=item0 style="display:none"><tr valign="center">" +
                        "<td align="left" width="80px">" +
                        "<div id=item_image0 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://news.google.com" target="_blank">" +
                        "<img src="http://www.themarker.com/ads/2005/haareEng/zahal/2/banner_haaretz3.jpg" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item1 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="center" width="80px">" +
                        "<div id=item_image1 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.yotvata.co.il" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item2 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="right" width="80px">" +
                        "<div id=item_image2 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.eliteintcafe.com" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item3 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="center" width="80px">" +
                        "<div id=item_image3 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.ymhoney.co.il" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item4 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="center" width="80px">" +
                        "<div id=item_image4 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.ganir.co.il" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item5 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="center" width="80px">" +
                        "<div id=item_image5 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.energy.co.il" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<tbody id=item6 style="display:none">" +
                        "<tr valign="top">" +
                        "<td align="center" width="80px">" +
                        "<div id=item_image6 " +
                        "style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                        "<a href="http://www.glidat-strauss.co.il" target="_blank">" +
                        "<img src="http://www.google.com/intl/en/images/logo.gif" width="120" vspace="0" border=0></a>" +
                        "</div></td></tr></tbody>" +
                        "<script language="javascript" >" +
                        "var max_docs = 7;" +
                        "</script>" +
                        "</table>" +
                        "<script language="javascript" type="text/javascript">HandleTimeout();" +
                        "</script>");
                   //myForm.addComponent(frag);
              }// End test
              private void renderIconLink(IconInfo myIcon, Form myForm, int count){
                   icon = myIcon.getIcon();
                   link = myIcon.getLink();
                   tooltip = myIcon.getTooltip();
                   myForm.addRawText("" +
                        "<tbody id=item" + count + " style="display:none">" +
                             "<tr valign="center">" +
                                  "<td align="left" width="80px">" +
                                       "<div id=item_image" + count + " style="filter:RevealTrans(duration=1); VISIBILITY: visible; WIDTH: 80px;">" +
                                            "<a href="" + link + "" target="_blank">" +
                                            "<img src="" + icon + "" width="120" vspace="0" border=0 alt="" + tooltip + ""></a>" +
                                       "</div>" +
                                  "</td>" +
                             "</tr>" +
                        "</tbody>");
              }// End method renderIconLink
         }// End Class IconLinksDynPage
    }// End Class RotatingIconLinks_Parameters
    I like to think that it's pretty self explanatory but I know that reading other peoples code can be a nightmare. Have a look at it and if you have any questions then feel free to post them.
    What it does is read iView paramaters for image location (URL from KM) and a URL that'll be the link and just displays the images and links to that URL, fading one into the other.
    What you should probably do though is ignore the paramter reading and just run the 'test()' method from doProcessBeforeOutput(). Have a look at the HTML and JavaScript that gets written, play with the imagesource and href parameters that are written in the code, see what it does. Then just modify it to use the images/urls' that you want.
    Let me know if you need anything cleared up,
    Patrick.

Maybe you are looking for

  • Sharing iTunes library on one windows computer with multiple accounts

    Should be a simple process but from what I have gathered, based on the iTunes help page pertaining to this procedure, you copy the iTunes Media Folder to a shared location. I do not have a problem with that but it then states you must consolidate, wh

  • I can no longer log on to itunes store

    I can no longer log on to itunes store or icloud Can someone help me?

  • WAS 6.2 upgrade to WAS 7.0

    Hi Experts, We want to upgrade from WAS 6.2 to WAS7.0. 1. Can we directly upgrade from 6.2 to 7.0 we can bypass going to 6.4? 2. Or do we need to upgrade from WAS 6.2 to WAS6.4 and then to 7.0 ? 3. We also have few BSP applications on 6.2. What would

  • Report Designer - New Page

    Hi, We have created a report designer report that uses a Cost Center hierarchy. We want to display each node of the hierarchy on a new page. There is an option to select Page Break Before/After for the hierarchy header. If we select Page Break Before

  • Producer consumer problem - semaphores

    problem solved. Message was edited by: nasher