×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    179

    Exclamation traversing images in canvas(urgent)

    I have placed four images in canvas , and have placed a white color rounded rectangle around them , i want to traverse those images and when the image is selected , i want to change the color of rounded rectangle to black, please help me or guide me how can i achieve it .....

    thanks and regards
    Arunesh

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: traversing images in canvas(urgent)

    Quote Originally Posted by Arunesh View Post
    I have placed four images in canvas , and have placed a white color rounded rectangle around them , i want to traverse those images and when the image is selected , i want to change the color of rounded rectangle to black, please help me or guide me how can i achieve it .....

    thanks and regards
    Arunesh
    Hello,

    You can draw the all the four images in the fashion you wanted to.Take an integer variable called as currentImageSelection=0;
    Now draw the while color selecteor using the currentImageSelection variable.
    Like

    graphics.fillRect(xOFFset,yOffset*(currentImageSelection+SPACE_BETWEEN_IMAGE),rect_width,rect_height);

    Now in keypressed, on the up and down key pressed please increase or decrease the currentImageSelection variable by one.Now on keyCode -5 (For Nokia Devices) you have to change the color of the rectangle only,

    Thats all you have to do,
    Please check whether these lines are of any help
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    179

    Exclamation Re: traversing images in canvas(urgent)

    i am only able to show four images in my screen, i have to show 8 images , further when the image is selected , the screen should scroll down, i am not getting the funda of scrolling the screen down to show the other 4 images ..
    please help me ...

    thanks and regards
    Arunesh

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: traversing images in canvas(urgent)

    Hello,
    You have to write your own logic. You can move ahead like this, you can take the screnWidth and screenHeight, and you know the width and height of the images you are gonna draw.
    Then devide the screenwidth and screeheight by the width and height of the images.
    By this you can have the maximum number of rows and coloumns visible at the one time.

    Now you can manage the current Row on the down and up key pressed.If the currentImageSelection is greater then the maximum no of rows,then you have to move the total row (that means y position has to be decreased) by the space between items.

    Make this logic clear and try to implement the same,I am sure this can fix the problem you are lloking to make possible.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Incorrect rgb values for jpg images on S40 3rd ed
    By bjudfar in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-05-29, 16:34
  2. Help with creating Images..Pls
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-03-02, 01:58
  3. Where are images inserted in .jar archive?
    By trussolillo in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-11-17, 08:31
  4. images..
    By zac123 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-07-19, 03:01
  5. Problem with PNG Images
    By cyphre666 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2003-12-12, 18:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×