×

Discussion Board

Results 1 to 8 of 8

Thread: Image sliding

  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    80

    Image sliding

    i want to have something like photo browing. there are several images. when an input is inputed, current image will slide out of display and new image will slide in to display.

    can anyone tell me how to do the slide in and slide out of images?

  2. #2
    Regular Contributor
    Join Date
    May 2007
    Location
    India
    Posts
    208

    Re: Image sliding

    Try this -
    Suppose you are using a device of screen size 240x320.You can draw the first image on canvas at x and y coordinate as 0,0. Draw the next image at 240,0. Naturally, the second image won't get displayed. Now start a thread and gradually decrease the x coordinate values of both the coordinates. A time will come when first image will have drawing origin as -240,0 and second image will have 0,0. this way it will appear as if first is sliding from right to left and second image is taking its place. that's it.

    Similarly, you may slide the images vertically also.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: Image sliding

    You can also use LWUIT for it, which provides standard screen transitions effects to support these type of features.

    thanks,
    ~Amitabh

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Image sliding

    or the graphics effects library of jappit, whcih also got several examples on the Wiki...

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    80

    Re: Image sliding

    Quote Originally Posted by gaurav007 View Post
    Try this -
    Suppose you are using a device of screen size 240x320.You can draw the first image on canvas at x and y coordinate as 0,0. Draw the next image at 240,0. Naturally, the second image won't get displayed. Now start a thread and gradually decrease the x coordinate values of both the coordinates. A time will come when first image will have drawing origin as -240,0 and second image will have 0,0. this way it will appear as if first is sliding from right to left and second image is taking its place. that's it.

    Similarly, you may slide the images vertically also.
    i used your method to slide the image. The image can slide from one end to another. However, sometimes, the image will jump to the next image without sliding. I would say that it slide too fast that with human eye, it looks like it jumps to another image. This does not happen always but sometimes. Can anyone tell me why?

  6. #6
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Image sliding

    maybe some kind of threading issue ?
    are you doing any calculations or cpu intensive tasks ?
    have you given a look at jappit's library instead of re-inventing the wheel

  7. #7
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    80

    Re: Image sliding

    Quote Originally Posted by Tiger79 View Post
    maybe some kind of threading issue ?
    are you doing any calculations or cpu intensive tasks ?
    have you given a look at jappit's library instead of re-inventing the wheel
    no, i never tried jappit's lib. can you give the link the examples you mention on wiki?

  8. #8
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Image sliding

    personally I'd advise you to actually go and explore the wiki yourself !
    See it as a great investment of your time, you will learn how to navigate in it, you will see what is offered on the wiki and even better : you might want to feel inspired to contribute to it yourself !
    You can find the Wiki right next to the Duiscussion Boards tab on top of your screen...
    Good luck and more importantly have fun ! There are loads of very very interesting wiki articles !

Similar Threads

  1. Image to byte[] (without getRGB)
    By lospatzos in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2009-07-28, 17:46
  2. Image Transparency issue
    By tomcruise in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-05-31, 15:46
  3. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31
  4. image failed to load
    By killarkai in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2003-07-25, 13:07
  5. image transparency gets lost with DirectUtils.createImage
    By rawpsycho in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2003-05-28, 08:36

Posting Permissions

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