iOS Question Slow moving compass

Discussion in 'iOS Questions' started by Albi, Mar 26, 2015.

  1. Albi

    Albi Active Member Licensed User

    I was trying to do a B4i version of a B4A compass. There is no animation library so I used a canvas to make the compass.

    I have two problems I can't work out.
    1. The compass seems to move pretty slowly around. Is there a way to make it more responsive? I appreciate it might be because of how the heading updates quite slowly, but perhaps there's a way to change that too?
    2. When I open the panel/canvas from a second page, the image doesn't refresh properly. It seems to start small, resize itself, but the smaller image doesn't get removed.

    I've attached a code I have used. Any help and tips are much appreciated!
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Your code is very inefficient as it loads the large image every time. Load it once and use the same bitmap object.
     
  3. Albi

    Albi Active Member Licensed User

    thanks. I changed it and also made it a smaller file size so it is much more responsive now.

    i do have another issue with the images. I am only using a needle image, with a transparent background so i can put it on the compass. When it rotates, it doesn't remove the old image, so it becomes blurry. I've attached an image showing the problem.

    I've also attached the project if that helps.
     

    Attached Files:

  4. narek adonts

    narek adonts Well-Known Member Licensed User

    I am not able to test your project because a png file is missing but try this before cvsNeedle.drawBitmap.

    cvsNeedle.DrawColor(colors.white) and after draw the bitmap

    narek
     
    Albi likes this.
  5. Albi

    Albi Active Member Licensed User

    thanks, that has done the trick!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice