2

I followed the link but its not perfectly working..

Main Code

private void drawFrame() {
        final SurfaceHolder holder = getSurfaceHolder();
        Canvas c = null;

        try {
            c = holder.lockCanvas();

            if (c != null) {

              c.save();
              c.translate((float)x_offcet,0);

                if (backgroundBitmap != null) {

                    c.drawBitmap(backgroundBitmap, 0, 0, null);

                }
               c.restore();
            }

        } finally {

            if (c != null) {
                holder.unlockCanvasAndPost(c);
            }
        }

        mHandler.removeCallbacks(run);

        if (visible) {
            mHandler.postDelayed(run, INTERVAL);
        }
    }

   @Override
    public void onOffsetsChanged(float xOffset, float yOffset,
            float xOffsetStep, float yOffsetStep, int xPixelOffset,
            int yPixelOffset) {

         x_offcet = xPixelOffset;

         drawFrame();
    }

Any idea/suggestion would be highly appreciated..

Community
  • 1
  • 1
moDev
  • 5,248
  • 4
  • 33
  • 63

0 Answers0