Results 1 to 10 of 10
  1. #1
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default Image Array object problem

    how i can pass Image Array object in createImage(Image image, int x, int y, int width, int height, int transform) method.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,316
    Blog Entries
    7
    Rep Power
    25

    Default

    Pass all elements one by one to your method because it can handle one image only, not an array of them. A loop comes to mind ...

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  3. #3
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default

    thanks i will do this.

  4. #4
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default

    sorry i m new in j2me .i m not capable to do this can u give any idea or example.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,316
    Blog Entries
    7
    Rep Power
    25

    Default

    Quote Originally Posted by Ashish_jain View Post
    sorry i m new in j2me .i m not capable to do this can u give any idea or example.
    Java Code:
    Image[] yourArray= ...;
    for (Image i : yourArray)
       createImage(i, ... );
    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  6. #6
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default

    private Image[] Cri_image;//declear
    Cri_image = new Image[4];

    pimgTemp = Image.createImage(m_imgAnim,10,0,m_iFrameWidth,iFrameHeight,Sprite.TRANS_NONE );
    Last edited by Ashish_jain; 07-04-2011 at 01:18 PM.

  7. #7
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default

    how can use i variable inside Image.createImage();

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,316
    Blog Entries
    7
    Rep Power
    25

    Default

    I don't understand what you mean by that. Please ask a proper question and don't make us guess.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  9. #9
    Ashish_jain's Avatar
    Ashish_jain is offline Member
    Join Date
    Jun 2011
    Posts
    32
    Rep Power
    0

    Default

    u said that i use this logic-
    Image[] yourArray= ...;
    for (Image i : yourArray)
    createImage(i, ... );
    but how can use i variable inside Image.createImage();

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,316
    Blog Entries
    7
    Rep Power
    25

    Default

    Quote Originally Posted by Ashish_jain View Post
    u said that i use this logic-
    Image[] yourArray= ...;
    for (Image i : yourArray)
    createImage(i, ... );
    but how can use i variable inside Image.createImage();
    It's the first parameter (an Image) for your method. I don't know what that method does but my code snippet indicated how you could pass an image from your array to it.

    kind regards,

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Replies: 2
    Last Post: 10-28-2010, 02:33 PM
  2. Replies: 23
    Last Post: 09-07-2010, 08:12 PM
  3. Java Array object problem
    By kozik in forum New To Java
    Replies: 13
    Last Post: 04-20-2009, 10:37 PM
  4. Conversion of image object into file
    By aartheesrini in forum Java Applets
    Replies: 0
    Last Post: 03-12-2009, 09:09 AM
  5. algorithm to cut an object from an image
    By TamTam in forum Java 2D
    Replies: 2
    Last Post: 02-27-2009, 11:01 PM

Posting Permissions

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