×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    May 2004
    Location
    Mumbai
    Posts
    58

    drawPolygon(.......) of Nokia UI API

    Hi,

    I have 2 arrays of type short and i want to pass them as an argument to the drawPolygon method of Nokia UI API.

    but the method accepts int []'s only.

    if i convert my short []'s to int , the runtime memory usage increases to 7400 bytes.

    can ne one hlp me find a solution to this??

    p.s. :- array type casting does not wrk.

    awaiting.....

    Gaurav.

  2. #2
    Registered User
    Join Date
    Apr 2004
    Posts
    14
    you can use the function
    System.arraycopy(ShortArrayVariable,0,IntArrayVariable,0,length)

    Then u can pass the IntArrayVariable as a parameter
    to fillPolygon

    This is an optimized function which sun has implemented
    in J2ME to copy array so that programmers avoid
    using the common method of for loop and manually
    copy one by one array element

    For reference see the following link
    http://www.developer.com/java/j2me/a...0934_2234631_4

    EnJoY

Posting Permissions

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