开发者

android wallpaper onOffsetsChanged image shadow

开发者 https://www.devze.com 2023-03-08 05:53 出处:网络
public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset,
public void onOffsetsChanged(float xOffset, float yOffset,
float xOffsetStep, float yOffsetStep, int xPixelOffset,
int yPixelOffset) {

after onOffsetsChanged, I run my draw method, which has

c.drawBitmap(_background, xPixelOffset, 0, null);

when I swipe/scroll to the right on the screen, the image displays correctly.

But if I scroll all the way left, the right part of the image is repeated in a pattern...like instead of displaying...say a...X on the screen, it is showing XXXXXXXXXXXXXXXX like a shadow effect

I tried different width size pictures, some are better, some are worse...but I can't seem to pinpoint the problem

Could someone comment on why this might be happening?

开发者_Python百科thanks


I would guess that you are drawing your bitmap offset so it isn't completely drawing the surface, and the artifacts you are seeing is just previously drawn junk left in the surface that you haven't touched when drawing the new frame. You'd need to either erase it to some color, or not allow the bitmap to move in a way that makes it no longer cover the entire surface.

0

精彩评论

暂无评论...
验证码 换一张
取 消