Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor vineetbillorey's Avatar
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155
    how to get alpha,red,green,blue values from getRGB() in j2me in respective arrays.
    Vineet Billorey "The Great"

  2. #2
    Registered User grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    PHP Code:
    int width img.getWidth();
    int height img.getHeight();
    int[] pixels = new int[width height];
    img.getRGB(pixels0width00widthheight);

    byte[] alpha = new byte[pixels.length];
    byte[] red   = new byte[pixels.length];
    byte[] green = new byte[pixels.length];
    byte[] blue  = new byte[pixels.length];

    for (
    int i 0pixels.lengthi++) {
        
    int pixel pixels[i];
        
    alpha[i] = (byte)(pixel >> 24);
        
    red[i]   = (byte)(pixel >> 16);
        
    green[i] = (byte)(pixel >>  8);
        
    blue[i]  = (bytepixel;


  3. #3
    Regular Contributor vineetbillorey's Avatar
    Join Date
    Aug 2008
    Location
    Gurgaon, India
    Posts
    155
    thanx for ur code.
    Vineet Billorey "The Great"

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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved