[HELP] Changing Images

Hi all,
Im new to this forum so please help me
I have downloaded a website template from a website.
After downloading the template, the following files are
downloaded:
- A map "images" (all images are .JPG or .GIF)
- A HTML File called "Index"
- A CSS File called "style"
- A PSD Document called "template13" (Name of the template i
downloaded)
I opened the "template13" file and changed it my way.
At the website there is a banner.
with the following text: "Web technologies company"
I changed it to my company name, i did it this way:
- I opened the .PSD file thats called template13.psd
- I Changed the Text and the slogan.
- I Saved the file "template13.psd
When I open the index.HTML file in Dreamweaver, i still see
"Webtechnologies Company".
My question is: how do i change the "Webtechnologies Company"
into my own text at the .HTML File?
Regards,
Nezzu

Try finding the header image with the company name on it. It
probably is a gif file. One thing I don't get is what you mean by
"A map "images" " ? waht do you mean? Usually you change the text
in the image that is linked to the template. You may have to change
the image for another the same size and name but with the company
name redone in the photoshop (.psd) file and saved for the web in
phtoshop. ie. find the siz e of the header image in pixels and
replace with one of the same size - flattened - with the same file
name and as the same file type. But hard to really know how they
did it without more details.

Similar Messages

  • Help changing image using multiple links

    Hello, I need help!
    How do I change a single image within a page, using multiple link words?
    I've seen this done all over, but can't figure this out! HELP!
    I am trying to have a single image, that will change as the different words are clicked on.
    This has got to be sooo simple!    
    I'm new to CS4.

    Four Level's Light box will do this:
    http://www.fourlevel.com/dreamweaver/extensions/lightbox/index.htm
    Kaosweaver has several Gallery extensions that may do what you need. (Search the Gallery)
    http://www.kaosweaver.com/extensions/index.php
    Project Seven's Image Gallery Magic works very well:
    http://www.projectseven.com/products/galleries/hgmagic/index.htm
    If you know how to work with code, JQuery Galleries are another option to consider:
    http://www.queness.com/post/222/10-jquery-photo-gallery-and-slider-plugins
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.com/blogspot.com

  • Changing Images at Runtime...it's sending me nuts (I'm a newbie, go easy)

    Hi all,
    I am trying change images at runtime and quite frankly it's driving me nuts. I'm pretty new to Java and don't understand some of the principles but I'm trying. I have this code below, that loads up a few images. I want to be able to change some/all of these images either on a timed even or on a button press, but all the things I've tried don't work. Can someone offer me some help....thanks in advance
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class bc extends JFrame implements ActionListener {
         public static void main(String[] args) {new bc();}
         bc() {
              //setUndecorated(true); // - this removed the titlebar!
                    setTitle("BC...");
              setSize(350,125);
              setResizable(false);
              setLocation(50,50);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setBackground(new Color(0,0,0));
              getContentPane().setBackground(new Color(255,255,255));
              JPanel hours = new JPanel();
              hours.setLayout(new GridLayout(4,2));
              hours.add(hour14);
              hours.add(hour24);
              hours.add(hour13);
              hours.add(hour23);
              hours.add(hour12);
              hours.add(hour22);
              hours.add(hour11);
              hours.add(hour21);
              JPanel mins = new JPanel();
              mins.setLayout(new GridLayout(4,2));
              mins.add(min14);
              mins.add(min24);
              mins.add(min13);
              mins.add(min23);
              mins.add(min12);
              mins.add(min22);
              mins.add(min11);
              mins.add(min21);
              JPanel secs = new JPanel();
              secs.setLayout(new GridLayout(4,2));
              secs.add(sec14);
              secs.add(sec24);
              secs.add(sec13);
              secs.add(sec23);
              secs.add(sec12);
              secs.add(sec22);
              secs.add(sec11);
              secs.add(sec21);
              JPanel helptext = new JPanel();
              helptext.setLayout(new GridLayout(4,2));
              helptext.add(new JLabel("8"));
              helptext.add(new JLabel("4"));
              helptext.add(new JLabel("2"));
              helptext.add(new JLabel("1"));
    //add action listenters
              changeImg.addActionListener(this);
              JPanel cp = new JPanel();
              cp.setLayout(new GridLayout(1,6));
              cp.setBackground(new Color(255,255,255));
              cp.add(hours);
              cp.add(mins);
              cp.add(secs);
              cp.add(helptext);
              cp.add(changeImg);
              setContentPane(cp);
              setVisible(true);
         public void actionPerformed(ActionEvent ae) {
              hour11.PaintOff(1);
              //JOptionPane.showMessageDialog(this, "changed");
              repaint();
    JPanel hour11 = new PaintOff(0);
    JPanel hour12 = new PaintOff(0);
    JPanel hour13 = new PaintBlank();
    JPanel hour14 = new PaintBlank();
    JPanel hour21 = new PaintOff(0);
    JPanel hour22 = new PaintOff(0);
    JPanel hour23 = new PaintBlank();
    JPanel hour24 = new PaintBlank();
    JPanel min11 = new PaintOff(0);
    JPanel min12 = new PaintOff(0);
    JPanel min13 = new PaintOff(0);
    JPanel min14 = new PaintOff(0);
    JPanel min21 = new PaintOff(0);
    JPanel min22 = new PaintOff(0);
    JPanel min23 = new PaintOff(0);
    JPanel min24 = new PaintOff(0);
    JPanel sec11 = new PaintOff(0);
    JPanel sec12 = new PaintOff(0);
    JPanel sec13 = new PaintOff(0);
    JPanel sec14 = new PaintOff(0);
    JPanel sec21 = new PaintOff(0);
    JPanel sec22 = new PaintOff(0);
    JPanel sec23 = new PaintOff(0);
    JPanel sec24 = new PaintOff(0);
    JButton changeImg = new JButton("change");
    }///---------This is my PaintOff class ---------------\\\
    import javax.swing.*;
    import java.awt.*;
    import java.awt.Image.*;
    public class PaintOff extends JPanel {
    Toolkit tk = Toolkit.getDefaultToolkit();
    public Image imgOff = tk.getImage("off.jpg");
    public Image imgOn = tk.getImage("on.jpg");
    public Image paintMe = tk.getImage("off.jpg");
         PaintOff(int a) {
              if(a == 1) {
                   vOn();
              } else {
                   vOff();
         public void vOn() {
            paintMe = imgOn;
         //JOptionPane.showMessageDialog(new bc(), "shown");
         public void vOff() {
            paintMe = imgOff;
         public void paintComponent(Graphics g) {
              g.drawImage(paintMe,0,0,this);
    }PaintBlank class is not included here, it's basically just the same as PaintOff but only has one image inside.
    When I try and compile this code, I get
    C:\jdk1.4\bin\bclock>javac bc.java
    bc.java:79: cannot resolve symbol
    symbol : method PaintOff (int)
    location: class javax.swing.JPanel
    hour11.PaintOff(1);
    ^
    1 error
    I don't understand this either, I've tried replacing "PaintOff(1)" with "vOn()" but I get the same error. This is baffling to be, as I thought that the hour11 would have access to all the methods inside the PaintOff class?
    Anyway, thanks for any help you guys give me!
    Cheers
    //Chris.

    Hi!
    Your problem is that you've used a widening conversion to convert from PaintOff to a JPanel. JPanel has no such method, and so the compiler is complaining that it can't find it.
    e.g
    public class NoCompile{
         public static void main(String args[]){
              One one = new Two();
              one.methTwo();
    public class Two extends One{
         public Two(){}
         public void methTwo(){
            System.out.println("Executed 2");
    public class One{
         public One(){}
         public void meth1(){}
    } will give you the same sort of error message. To make the compiler happy, use a cast.
    Now this will compile and gives the right result.
    public class NoCompile{
         public static void main(String args[]){
              One one = new Two();
              ((Two)one).methTwo();
    }So in your case, you want to do
    ((PaintOff)hour11).vOn();
    Does that help?
    :) jen

  • How change image of a single folder?

    Is there a way to control the appearance of a single folder (or folder button, as I guess it's technically called) without changing the other buttons on a menu?
    When you add a folder, it defaults to a folder-like graphic. It seems that when you add content, the folder's image changes to a still from the first movie inside. I'd like to either keep it as the folder graphic, or be able to customize its appearance. Is this possible?
    Thanks in advance!
    Mike

    Hi Mike,
    iDVD 5 Help: Changing the image displayed on a button (almost 3/4 down the page)
    Does it help ?

  • Filter plugin. Problem after change image depth.

    Hi All !
    I already wrote filter plugin it work fine but only for image depth 8bit, after i change image depth on 16 or 32 bits I getting error msg box from photoshop.
    I try change on 'destination.colBits = 8' or 'destination.colBits = pChannel->depth' or ' (pChannel->bounds.bottom - pChannel->bounds.top) * pChannel->depth;'  but all the same.
    PixelMemoryDesc destination;
    destination.data = data; //*pixel
    destination.depth = pChannel->depth;
    destination.rowBits = (pChannel->bounds.right - pChannel->bounds.left) * pChannel->depth;
    destination.colBits = 8;
    destination.bitOffset = 0 ;
    Please help someone !
    Very Thanks in Advance !
    All code below:
    //  Gauss.cpp
    //  gauss
    //  Created by Dmitry Volkov on 30.12.14.
    //  Copyright (c) 2014 Automatic System Metering. All rights reserved.
    #include "Gauss.h"
    #include "GaussUI.h"
    #include "FilterBigDocument.h"
    #include <fstream>
    using namespace std;
    SPBasicSuite* sSPBasic = NULL;
    FilterRecord* gFilterRecord = NULL;
    PSChannelPortsSuite1* sPSChannelPortsSuite = NULL;
    PSBufferSuite2* sPSBufferSuite64 = NULL;
    int16* gResult = NULL;
    void DoParameters ();
    void DoPrepare ();
    void DoStart ();
    void DoFinish ();
    void DoEffect();
    void GaussianBlurEffect(ReadChannelDesc* pChannel, char* data);
    void ReadLayerData(ReadChannelDesc* pChannel, char* pLayerData);
    void WriteLayerData(ReadChannelDesc* pChannel, char* pLayerData);
    DLLExport MACPASCAL void PluginMain(const int16 selector,
                                        FilterRecordPtr filterRecord,
                                        intptr_t * data,
                                        int16 * result)
        sSPBasic = filterRecord->sSPBasic;
        gFilterRecord = filterRecord;
        gResult = result;
        try {
                if (sSPBasic->AcquireSuite(kPSChannelPortsSuite,
                                                   kPSChannelPortsSuiteVersion3,
                                                   (const void **)&sPSChannelPortsSuite))
                    *gResult = errPlugInHostInsufficient;
                if (sSPBasic->AcquireSuite( kPSBufferSuite,
                                                   kPSBufferSuiteVersion2,
                                                   (const void **)&sPSBufferSuite64))
                    *gResult = errPlugInHostInsufficient;
                if (sPSChannelPortsSuite == NULL || sPSBufferSuite64 == NULL)
                    *result = errPlugInHostInsufficient;
                    return;
                switch (selector)
                    case filterSelectorParameters:
                        DoParameters();
                        break;
                    case filterSelectorPrepare:
                        DoPrepare();
                        break;
                    case filterSelectorStart:
                        DoStart();
                        break;
                    case filterSelectorFinish:
                        DoFinish();
                        break;
        catch (...)
            if (NULL != result)
                *result = -1;
    void DoParameters ()
    void DoPrepare ()
    void DoStart ()
        if (*gResult == noErr)
            if (doUi())
                DoEffect();
    void DoFinish ()
    #define defColBits 8
    void DoEffect()
        // Start with the first target composite channel
        ReadChannelDesc *pChannel = gFilterRecord->documentInfo->targetCompositeChannels;
        // Calculation width and height our filter window
        int32 width = pChannel->bounds.right - pChannel->bounds.left;
        int32 height = pChannel->bounds.bottom - pChannel->bounds.top;
        fstream logFile ("/Volumes/Macintosh Media/GaussLogFile.txt", ios::out);
        logFile << endl << "top " << pChannel->bounds.top;
        logFile << endl << "bottom " << pChannel->bounds.bottom;
        logFile << endl << "left " << pChannel->bounds.left;
        logFile << endl << "right " << pChannel->bounds.right;
        logFile << endl << "depth " << pChannel->depth;
        logFile << endl << "vRes " << gFilterRecord->documentInfo->vResolution;
        logFile << endl << "hRes " << gFilterRecord->documentInfo->hResolution;
        // Get a buffer to hold each channel as we process. Note we can using standart malloc(size_t) or operator new(size_t)
        // functions, but  Adobe recommend sPSBufferSuite64->New() for memory allocation
        char *pLayerData = sPSBufferSuite64->New(NULL, width*height*pChannel->depth/8);
        if (pLayerData == NULL)
            return;
        // we may have a multichannel document
        if (pChannel == NULL)
            pChannel = gFilterRecord->documentInfo->alphaChannels;
        // Loop through each of the channels
        while (pChannel != NULL && *gResult == noErr)
            ReadLayerData(pChannel, pLayerData);
            GaussianBlurEffect(pChannel, pLayerData);
            WriteLayerData(pChannel, pLayerData);
            // off to the next channel
            pChannel = pChannel->next;
        pChannel = gFilterRecord->documentInfo->targetTransparency;
        // Delete pLayerData
        sPSBufferSuite64->Dispose((char**)&pLayerData);
    void GaussianBlurEffect(ReadChannelDesc* pChannel, char *data)
        // Make sure Photoshop supports the Gaussian Blur operation
        Boolean supported;
        if (sPSChannelPortsSuite->SupportsOperation(PSChannelPortGaussianBlurFilter,
                                                    &supported))
            return;
        if (!supported)
            return;
        // Set up a local rect for the size of our port
        VRect writeRect = pChannel->bounds;
        PIChannelPort inPort, outPort;
        // Photoshop will make us a new port and manage the memory for us
        if (sPSChannelPortsSuite->New(&inPort,
                                      &writeRect,
                                      pChannel->depth,
                                      true))
            return;
        if (sPSChannelPortsSuite->New(&outPort,
                                      &writeRect,
                                      pChannel->depth,
                                      true))
            return;
        // Set up a PixelMemoryDesc to tell how our channel data is layed out
        PixelMemoryDesc destination;
        destination.data = data; //*pixel
        destination.depth = pChannel->depth;
        destination.rowBits = (pChannel->bounds.right - pChannel->bounds.left) * pChannel->depth;
        destination.colBits = defColBits;
        destination.bitOffset = 0 ;
        // Write the current effect we have into this port
        if (sPSChannelPortsSuite->WritePixelsToBaseLevel(inPort,
                                                         &writeRect,
                                                         &destination))
            return;
        // Set up the paramaters for the Gaussian Blur
        PSGaussianBlurParameters gbp;
        int inRadius = 1;
        Fixed what = inRadius << 16;
        gbp.radius = what;
        gbp.padding = -1;
        sPSChannelPortsSuite->ApplyOperation(PSChannelPortGaussianBlurFilter,
                                                                 inPort,
                                                                 outPort,
                                                                 NULL,
                                                                 (void*)&gbp,
                                                                 &writeRect);
        if (sPSChannelPortsSuite->ReadPixelsFromLevel(outPort,
                                                      0,
                                                      &writeRect,
                                                      &destination))
            return;
        // Delete the temp port in use
        sPSChannelPortsSuite->Dispose(&inPort);
        sPSChannelPortsSuite->Dispose(&outPort);
    void ReadLayerData(ReadChannelDesc *pChannel, char *pLayerData)
        // Make sure there is something for me to read from
        Boolean canRead;
        if (pChannel == NULL)
            canRead = false;
        else if (pChannel->port == NULL)
            canRead = false;
        else if (sPSChannelPortsSuite->CanRead(pChannel->port, &canRead))
            // this function should not error, tell the host accordingly
            *gResult = errPlugInHostInsufficient;
            return;
        // if everything is still ok we will continue
        if (!canRead || pLayerData == NULL)
            return;
        // some local variables to play with
        VRect readRect = pChannel->bounds;
        PixelMemoryDesc destination;
        // set up the PixelMemoryDesc
        destination.data = pLayerData;
        destination.depth = pChannel->depth;
        destination.rowBits = pChannel->depth * (readRect.right - readRect.left);
        destination.colBits = defColBits;
        destination.bitOffset = 0 ;
        // Read this data into our buffer, you could check the read_rect to see if
        // you got everything you desired
        if (sPSChannelPortsSuite->ReadPixelsFromLevel(
                                                      pChannel->port,
                                                      0,
                                                      &readRect,
                                                      &destination))
            *gResult = errPlugInHostInsufficient;
            return;
    void WriteLayerData(ReadChannelDesc *pChannel, char *pLayerData)
        Boolean canWrite = true;
        if (pChannel == NULL || pLayerData == NULL)
            canWrite = false;
        else if (pChannel->writePort == NULL)
            canWrite = false;
        else if (sPSChannelPortsSuite->CanWrite(pChannel->writePort, &canWrite))
            *gResult = errPlugInHostInsufficient;
            return;
        if (!canWrite)
            return;
        VRect writeRect = pChannel->bounds;
        PixelMemoryDesc destination;
        destination.data = pLayerData;
        destination.depth = pChannel->depth;
        destination.rowBits = pChannel->depth * (writeRect.right - writeRect.left); //HSIZE * pChannel->depth * gXFactor*2;
        destination.colBits = defColBits;
        destination.bitOffset = 0 ;
        if (sPSChannelPortsSuite->WritePixelsToBaseLevel(
                                                         pChannel->writePort,
                                                         &writeRect,
                                                         &destination))
            *gResult = errPlugInHostInsufficient;
            return;

    Have you reviewed your code vs the Dissolve example? It is enabled for other bit depths as well.

  • Menu Buttons Change Image instead of Highlighting?

    Does anyone know how to/or if it's possible to make a DVD menu in Photoshop for Encore where, when the menu button is highlighted it actually changes image instead of making it a solid highlighted colour?
    For example...
    In a DVD i'm making, I have Cartoon images that are the menu buttons. I would like to make it so that when you select it on your dvd player it makes the eyes open up wider and mouths of the characters open up. I have made the duplicate layers and changed one to have the open eyes and mouth and placed it directly ontop of the other and put both layers in the one group with the (+) to allow Encore to recognize it. But all I get is the top layer of the two turning to a top colour. I know that using prefixes like (=1) makes it highlighted and that is why it's highlighting but I don't know what else to suggest. I've looked at the prefixes on the Encore help on this site and tried to work it out but no luck
    I know this is due to my lack of knowledge and really need some help to fix it, or know if it's even possible (I assume tht using such great products as Adobe it will be)
    Thanx

    Welcome to the forum.
    This is easily done by doing dupe Menus for each Button. The Button on the original Menu will be set to Auto-Activate, and be linked to the dupe Menu with the different graphic. I would probably turn OFF Sub-picture Highlights.
    The trick is to do a layout, and also name your Menus (especially the dupes), to reflect exactly what they do. I use Illustrator for my layout, but pencil and paper work well too.
    Note: if run on a computer, the user will need to Dbl-click the Button, as Auto-Activate only works seamlessly from a DVD set-top player.
    There are several other posts on this forum (a few very recent), where I go into much more detail. Also, Jeff Bellune's excellent book, The Focal Easy Guide to Adobe EncoreDVD 2.0, by Focal Press, has excellent, easy to follow steps for doing this. Though written for EncoreDVD 2.0, 100% of the book will apply to CS3 & CS4.
    Good luck,
    Hunt

  • Changing images on jsp

    I created a jsp page with a button and a image (ImageComponent). When the button is pressed a picture is retrieved from a database and saved on the CLIENTs harddrive (ex: "C:\\img.jpg"). After this the image should be changed to the picture just downloaded from the database.
    The tried to call the methode:
    image.setUrl("C:\\img.jpg");
    then the current image dissapears, but the new image isn't displayed.
    Did I used the right methode, or should I just call some kind of refresh methode? Can you please help.
    THANX

    Google "banner rotation".
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "informatic-tec" <[email protected]> wrote in
    message
    news:efj729$mpa$[email protected]..
    > Hellow to everybody, i would like to know witch is the
    html code or script
    > that let me change images on and web page any time i
    refres it.
    >
    > I would like to make a page with 4 images at the top,
    that change
    > any time that one user refresh it.
    >
    > Thanks to anyone who can help me.
    >
    > David
    >
    >
    >

  • Changing images on html

    Hellow to everybody, i would like to know witch is the html
    code or script
    that let me change images on and web page any time i refres
    it.
    I would like to make a page with 4 images at the top, that
    change
    any time that one user refresh it.
    Thanks to anyone who can help me.
    David

    Google "banner rotation".
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "informatic-tec" <[email protected]> wrote in
    message
    news:efj729$mpa$[email protected]..
    > Hellow to everybody, i would like to know witch is the
    html code or script
    > that let me change images on and web page any time i
    refres it.
    >
    > I would like to make a page with 4 images at the top,
    that change
    > any time that one user refresh it.
    >
    > Thanks to anyone who can help me.
    >
    > David
    >
    >
    >

  • Dreamweaver template won't change images

    I am using Dreamweaver 5 on a Macbook Pro and I have been trying to change the Header image in my site.  I would go in and change the image using the CSS panel but the image itself will not update.  I've tried deleting the old site definitions and recreating them only to have the same problem.
    Nothing will change on my template. It won't aknowledge my changed image "i have saved it under the same image name". i've tried changing the name of the image, re-loading it and still THE OLD IMAGE APPEARS!. What the heck is going on? Can someone please tell me where it is getting this image from when I have clearly changed the image, looked at image to confirm it is in fact the changed image prior to attaching it. 
    I am completely puzzled and Desperate as my client expects these changes. Thank you.  In the mean time I will try to just upload the changed image to the web and hope the template uses the updated image on the server.
    Thank you for any help you can offer.

    Dreamweaver 5 means Dreamweaver CS5 correct? Can you give us a bit more info on your workflow? How's your site set up? Where does this image reside in comparison to the root of the site folder (make sure the image gets saved to the site folder)? Is the file path to the image correct? Make sure to turn live view off and back on again?

  • Changing image prefix in Apex 4.1

    Hi guys,
    I installed APEX 4.1 with EPG on Oracle linux 6 and for some reason I want to change image prefix from */i/* to */i4/*.
    I browsed to apex/utilities and logged in sqlplus as sysdba and run the file:
    @reset_image_prefix.sql choosing */i4/* as my new prefix.
    then i tried:
    select id, flow_image_prefix from apex_040100.wwv_flows; all application now have the prefix /i4/ but when I go to http://myserver:8080/apex nothing is displayed !!!!
    when i change */i4/* back to */i/* everything is back to normal...
    please help :) ....

    Your results would be expected. You changed the image prefix to reference /i4/ which by default would not exist. Did you take any steps to actually create and load the files into /i4/?

  • Change image contrast

    Hi,
    I need to change image contrast, that code working for .bmp image only.
    public static BufferedImage rescale(BufferedImage indexed,
                   float scaleFactor, float offset) {
              System.out.println(indexed.getHeight());
              IndexColorModel icm = (IndexColorModel) indexed.getColorModel();
              return new BufferedImage(rescale(icm, scaleFactor, offset), indexed
                        .getRaster(), false, null);
    public static IndexColorModel rescale(IndexColorModel icm,
                   float scaleFactor, float offset) {
              int size = icm.getMapSize();
              byte[] reds = new byte[size], greens = new byte[size], blues = new byte[size], alphas = new byte[size];
              icm.getReds(reds);
              icm.getGreens(greens);
              icm.getBlues(blues);
              icm.getAlphas(alphas);
              rescale(reds, scaleFactor, offset);
              rescale(greens, scaleFactor, offset);
              rescale(blues, scaleFactor, offset);
              return new IndexColorModel(8, size, reds, greens, blues, alphas);
         public static void rescale(byte[] comps, float scaleFactor, float offset) {
              for (int i = 0; i < comps.length; ++i) {
                   int comp = 0xff & comps;
                   int newComp = Math.round(comp * scaleFactor + offset);
                   if (newComp < 0)
                        newComp = 0;
                   else if (newComp > 255)
                        newComp = 255;
                   comps[i] = (byte) newComp;
         }If i am use .jpeg or .jpg image then following error will appearjava.lang.ClassCastException: java.awt.image.ComponentColorModel
         at com.maan.image.DAO.ImageBean.rescale(ImageBean.java:141)
         at com.maan.image.DAO.ImageBean.loadImage(ImageBean.java:39)
         at org.apache.jsp.imgManipulation.alterImage_jsp._jspService(org.apache.jsp.imgManipulation.alterImage_jsp:59)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)any one help me, what i am going to do,
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My guess is that it's this line:
    IndexColorModel icm = (IndexColorModel) indexed.getColorModel(); The BufferedImage that you are sending to rescale probably uses a ComponentColorModel when you load from a .jpg and an IndexColorModel when you load from a .bmp file. You can't cast between the two. You may be able to do what you're trying to do by using the getRBG method from BufferedImage and forget about the ColorModel.

  • Change images on mouse click

    hi,
    cud anyone help me to change image in a JPanel in JFrame.On MouseClick event. the image should in an panel on mouseclick,plz explain with example source code.
    thank u

    I dvlp MyPanel to accept 2 image file name.
    You can easy change to accept Image instead of file name.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Test {
    public static void main(String args[]) {
    JFrame f = new JFrame("Test");
    MyPanel p = new MyPanel("YourFirstImage.gif", "YourSecondImage.gif");
    p.add(new JButton("Click on Panel (not Button)"));
    f.setContentPane(p);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.pack();
    f.setVisible(true);
    class MyPanel extends JPanel implements MouseListener {
    Image image, image1, image2;
    public MyPanel(String image1Name, String image2Name) {
    //load image
    try {
    image1 = getToolkit().getImage(getClass().getResource(image1Name));
    image2 = getToolkit().getImage(getClass().getResource(image2Name));
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image1, 0);
    mt.addImage(image2, 0);
    mt.waitForAll();
    } catch (Exception e) { e.printStackTrace(); }
    this.image1 = image1;
    this.image2 = image2;
    this.image = image1;
    this.addMouseListener(this);
    public void paintComponent(Graphics g) {
    g.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), this);
    public void mouseClicked(MouseEvent e){
    image = (image == image1) ? image2 : image1; // switch between image1, image2
    repaint();
    public Dimension getPreferredSize() {
    Dimension dim = super.getPreferredSize();
    int w = Math.max(image1.getWidth(this), image2.getWidth(this));
    int h = Math.max(image1.getHeight(this), image2.getHeight(this));
    w = Math.max(dim.width, w);
    h = Math.max(dim.height, h);
    return new Dimension(w, h);
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    public void mouseReleased(MouseEvent e) {}

  • How to change Images with ImageIcon

    Hello everyone, this is my first post on the forums.
    I am struggling at the moment to find a way to change images in my program. I am making a card game and when the user clicks a button it will replace the card he has with another card. I thought the following code would work but apparently it doesnt:
    String cardPathA = "image1.gif";
    ImageIcon imageCardA = new ImageIcon(cardPathA);   //cardPathA for example is image1.gif
    //during the program the user changes cards so it should now show image2.gif
    cardPathA = "image2.gif";
    imageCardA.setImage(cardPathA);The error occurs when compiling and it reads: "+setImage(java.awt.Image) in javax.swing.ImageIcon cannot be applied to (java.langlString)+".
    I have searched all over the internet and I haven't found anything. I would appreciate some help. Thanks :)

    im not really sure i made a quick example to show how I would change the imageIcon in a button, just change the paths for cardPathA and cardPathB for your pictures to get it working.
    The only other thing i can think of is maybe to call repaint() for the components you are trying to change the image?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class ImageChange extends JFrame implements ActionListener{
             final private String cardPathA;
            final private String cardPathB;
         private ImageIcon myImageIcon;
            private JButton changeCard;
            private int counter;
            private JPanel panel;
            private JButton imageButton;
         public ImageChange(){       
                changeCard = new JButton("Change Button");
                counter = 0;
                cardPathA = "1.gif";
                cardPathB = "2.gif";
                myImageIcon = new ImageIcon(cardPathA);
                imageButton = new JButton(myImageIcon);
            public void makeGui(){
                changeCard.addActionListener(this);
                panel = new JPanel(new BorderLayout());
                panel.add(changeCard,BorderLayout.NORTH);
                panel.add(imageButton,BorderLayout.CENTER);
                this.add(panel);
                this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
                this.pack();
                this.setVisible(true);
         public void actionPerformed (ActionEvent menuChoice){
                counter++;
                if(counter%2 ==0){             
                    myImageIcon = new ImageIcon(cardPathA);
                    imageButton.setIcon(myImageIcon);
                }else{
                    myImageIcon = new ImageIcon(cardPathB);
                    imageButton.setIcon(myImageIcon);
            public static void main(String[] args){
                ImageChange test = new ImageChange();
                test.makeGui();
    }Calypso

  • Changing image to Lineart

    I have just purschased Adobe Illustrator & need help changing my company logo to lineart so I'am able to have it screenprinted.
    What I'm trying to do is make a black outline around the image & lettering, then change the red parts of the image to white to white. I know it be pretty easy to achieve, but can't seem to figure it out.... Any help would be much appreciated
    Thank you in advance if anyone can advise me on how go about doing this

    First, draw a ractangle object outside the logo. Then send it to back by clicking ( Shift+Ctrl+[ ).
    -Apply the black Fill Color to the ractangle. click (F6) to show/hide the color pallete.
    -Then select the red color objects and change the colors: click (F6) to show/hide the color pallete. Select the "Fill Color" and change the color to white.
    1. Select "Square and Euro bistro", add "White Stroke" to it.
    2. Set "0.4pt" for the stroke weight. Click (Ctrl+F10) to show to the Stroke/Hide Command.
    3. Your logo will be like this.
    Be sure your logos must be vectors. If not, create a new one so that you can separate the vectors' appearances as described.
    Hope this is your command.
    LUCK

  • Photoshop Elements 5.0 - won't let me change image aspect ratio. Box is greyed out. Have reinstalled

    I've been using Photoshop Elements 5.0 for years.  As of today, it won't let me change image aspect ratio. Box is greyed out. Have reinstalled the program with no change

    Where in photoshop elements 5 are you seeing the "Box" geyed out?
    Or how are you trying to change the image aspect ratio?

Maybe you are looking for

  • Error while deploying Collections to Dev Environment

    Hi I am trying to deploy DC Modules (Collections) from OWB Repository to DEV1 environment. I am doing it as follows. OMB+> {color:#0000ff}OMBCONNECT user/pwd@host:port:schema {color}Connected. OMB+> {color:#0000ff}OMBCC '/DQ' {color}Context changed.

  • Zen Micro Prob

    My Zen Micro is no longer recognized by my PC with XP. I've tried uninstalling and reinstalling the disk several times but it doesn't work. I want to upgrade the firmware so I can use the player with a Vista PC however since the XP computer won't rec

  • Motion crashes when opening templetes

    Motion crashes when opening templetes. Any idea why this happenes? I have Intel Mac Pro 2.66 Intel Mac Pro 2.66   Mac OS X (10.4.8)  

  • Another antivirus for Windows 7 in Boot Camp if i have Intego Virus Barrier?

    Do I need another antivirus program for Windows 7 in Boot Camp if I have Intego Virus Barrier already installed on my Mac?

  • Dirty Writes to the database

    I have a value object which was originally populated with information from database. I have a requirement to update ONLY the data that was changed in the value object. I could come up with something clever to do it myself, or I could use an existing