×

Discussion Board

Results 1 to 10 of 10

Thread: Image SlideShow

  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    166

    Image SlideShow

    hi all
    i want to develop an application which scan the phone and memory and shows image slide show
    the scanning of memory should be automatically done also i want to crop a particular image

    thnks

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

    Thumbs up Re: Image SlideShow

    Hi,
    You can read the following link and you will be able to play with the image..
    http://developers.sun.com/mobility/r..._resizing.html
    and,
    Image image = Image.createImage(raw, 0, raw.length);

    private Image resizeImage(Image image) {
    int srcWidth = image.getWidth();
    int srcHeight = image.getHeight();

    int newWidth = 64;
    int newHeight = -1;

    if (thumbHeight == -1)
    newHeight = thumbWidth * srcHeight / srcWidth;

    Image newImage = Image.createImage(newWidth, newHeight);
    Graphics g = newImage.getGraphics();

    for (int y = 0; y < newHeight; y++) {
    for (int x = 0; x < newWidth; x++) {
    g.setClip(x, y, 1, 1);
    int dx = x * srcWidth / newWidth;
    int dy = y * srcHeight / newHeight;
    g.drawImage(image, x - dx, y - dy,
    Graphics.LEFT | Graphics.TOP);
    }
    }

    Image immutableImage = Image.createImage(newImage);

    return immutableImage;
    }
    Hope these lines can help you,
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Image SlideShow

    Hi,

    point by point:

    * to read device photo gallery, you need to use FileConnection API

    * to retrieve default photo gallery path (avoid hardcoding paths in your code) you can use the "fileconn.dir.photos" System property, as shown here: http://www.forum.nokia.com/document/...79F5BE26E.html

    * to crop an Image, you need to create a mutable Image with the createImage(int width, int height) method, and then copy the portion you wish from the original Image (the one you read from phone gallery) to the mutable one

    * to implement a slideshow, you just need to show an Image after another, and you can easily do it by using a Thread or a Timer. If you want, also check out this Java ME Image library, that will allow you to implement nice transitions between images.

    Hope it helps,
    Pit

  4. #4
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    166

    Re: Image SlideShow

    hello raj

    thnks for reply

    but
    i want to get images from memory without user interaction, if this is done the rest part will be simple

  5. #5
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    166

    Re: Image SlideShow

    thnks for reply
    pit

    il try it out seems like it will work

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

    Thumbs up Re: Image SlideShow

    Hi,
    For the rest part the post given by pi is best..you can follow the same and you will do it..Though he has given the perfect answer.

    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    166

    Re: Image SlideShow

    im using

    String urlImage = System.getProperty("fileconn.dir.photos");
    .
    .
    .
    .

    FileConnection fileconn =(FileConnection)Connector.open(urlImage);


    is there any method that will return number of images in the directory

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

    Thumbs up Re: Image SlideShow

    Hi Mahesh,
    I have worked a bit.not to much..What I know is you can use this method.
    To list the contents of a directory the FileConnection is pointing to, use the list() method, for
    example:
    try {
    FileConnection fc = (FileConnection)Connector.open("file:///SDCard/Doc/ doc1.txt",
    Connector.READ_WRITE);
    If (fc. isDirectory()) {
    Enumeration e = fc.list();
    while (e.hasMoreElements()) {
    System.out.println(((String)e.nextElement()));
    }
    }

    }catch( Exception e ){
    }
    Please find the link here..for more information.
    developer.motorola.com/docstools/technicalarticles/File_Connection_API_20060601.pdf
    Hope these lines can be helpful.
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    166

    Re: Image SlideShow

    can any one give file connection path for sony ericsson w580 memory card

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Image SlideShow

    For JP-5 onwards SonyEricsson devices, memory card path is "file:///e:/". You can check this document for other useful infos:

    https://developer.sonyericsson.com/g...do?docId=65067

    Pit

Similar Threads

  1. --- ???save image problem??? ---
    By ferenn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-10-01, 14:33
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 09:58
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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