Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Changing colors of large image in real time

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Changing colors of large image in real time

    Hi,

    I am trying to get an image raw data in an int[] array using getRGB() in order to change the color of the image.
    But it is working fine in simulator for any image. if i install it in real device say Nokia 6600 the getRGB() method is not

    working for large .png image like size (88X57) because the device gets hang while we are using large image but it is working

    fine for small image.

    Pls give me some idea how to use getRGB() for large image.

    Following is the sample code

    int imageWidth = img.getWidth();  
    int imageHeight = img.getHeight();
     
    int[] raw = new int[imageWidth*imageHeight];
    img.getRGB(raw, 0, imageWidth, 0, 0, imageWidth, imageHeight);



    Thanks in advance


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Changing colors of an image in real time

    I'm guessing this is happening because the phones memory can't handle images of this size?

    This is just a guess though as I have no real experience with Mobile applications.

    Is it possible to compress your image to .jpg?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. GUI problem with image in java
    By Koâk in forum AWT / Java Swing
    Replies: 6
    Last Post: May 17th, 2009, 04:17 AM
  2. How images stores in awt.Image class?
    By BharatT in forum AWT / Java Swing
    Replies: 0
    Last Post: February 24th, 2009, 05:10 AM
  3. How to Get the current date and time
    By JavaPF in forum Java Programming Tutorials
    Replies: 2
    Last Post: December 2nd, 2008, 01:55 PM
  4. How to import an .tiff image in JSP?
    By jazz2k8 in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: May 12th, 2008, 05:55 AM