×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Which Portion of The Canvas Has Changed?

    Hey Folks,

    I have search my need over the web, various Forums...however was not able to found any suitable and feasible solution for fulfilling the requirement.

    My requirement is not too big and complex and it really seems to be possible, what I want is that, how I can come to know that which portion of the drawn Canvas/Screen Image has been changed.By change What I mean is that either the whole or some portion of the drawn canvas gets changed compare to the canvas when the last time paint was called...I am really looking for the smaller portion of the image that gets changed...

    Kindly share your ideas/interesting solutions with me for the above requirement.I will be greatly thankful to you guy's if you can share your ideas.

    Thanks to them too who even read this post..
    Last edited by raj_J2ME; 2010-05-06 at 08:38. Reason: Explanation
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Which Portion of The Canvas Has Changed?

    afaik there is no standard API for that ?
    I guess that the only way would be to make a complete pixel-array of both images and check if there are differences inbetween them... most probably pretty slow if the Images are big and obviously pretty memory-consuming...

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

    Re: Which Portion of The Canvas Has Changed?

    Quote Originally Posted by Tiger79 View Post
    I guess that the only way would be to make a complete pixel-array of both images and check if there are differences inbetween them... most probably pretty slow if the Images are big and obviously pretty memory-consuming...
    Hello Tiger,
    Hey thanks for the reply man.
    Well, I do believe that there is not standard API for this however the solution you purposed sounds me much interesting. As I have done the much research about this solution and as you said the issue are like the Heap Memory.But I am looking for the solution of the portions of the image those has been changed. SO that the used heap can be minimized.

    Again the second issue is how to know the respective portions indexes/names that these are the two portions that has to compare?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Which Portion of The Canvas Has Changed?

    to know the portions that have changed I'd say you extract both Images in an Array, then you simply go through the two arrays and compare every single element (thus pixel-value), and then you could simply keep track of the first element that's different up to the last one... thus establishing which elements (pixels) have changed...
    I don't understand exactly what you are trying to say, but to me it looks like you only want to check which pixels changed of an area that changed ? That would seem impossible to me because you would need to know whcih specific area changed to begin with, making this a egg-chicken case :P
    Anyways, to cut the memroy-usage somewhat I would suggest to divide the whole area into little pieces and check for differences within those...
    So for example take a Canvas, divide it into a 3x3 grid and check every grid-item individually... Sounds easy, but I guess osme problems might arise when then changed area is divided over several grid-items...
    Also you still would need some backup of the grid-items for comparison-purposes when drawing a new grid-item for example, so I don't know if in the end you will be really saving on memory-usage... If the timing is right I guess you could, just save a grid-item, then paint the new one (not the whole canvas), compare those and you will know if there are differences...

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

    Re: Which Portion of The Canvas Has Changed?

    Thanks for the reply Tiger..

    I will do the analysis of the approach and will check the feasibility of the same.
    After this I will share the results.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. KERN-EXEC 3 Panic/OK for the same call
    By PACALA_BA in forum Symbian
    Replies: 8
    Last Post: 2009-12-01, 01:02
  2. Problem with setFullScreenMode(true) in canvas
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2008-12-06, 05:45
  3. How to create a partly transparent Canvas to lay on top of another Canvas?
    By mkleijer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2007-05-22, 07:00
  4. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46
  5. 7650 and 3650 Canvas and FullCanvas memory
    By marcilgen in forum Mobile Java General
    Replies: 5
    Last Post: 2003-07-08, 12:24

Posting Permissions

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