Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的屏幕上有一个大全景位图,我可以用手指滚动。但我不知道如何正确扩展它:
rectF.set(x, 0, x + [whatToPutHere], getMeasuredHeight) canvas.drawBitmap(bmpBackground, null, rectF, null
rectF.set(x, 0, x + [whatToPutHere], getMeasuredHeight)
canvas.drawBitmap(bmpBackground, null, rectF, null
whatToPutHere如果我希望它具有正确的尺寸,我必须放入什么?
whatToPutHere
我希望你知道我的意思
好的,我自己解决了这个问题:
我创建变量 int dimension = getMeasuredHeight()/bmpBackground.getHeight(); For whatToPutHereI put bmpBackground.getWidth()*dimension;
int dimension = getMeasuredHeight()/bmpBackground.getHeight();
bmpBackground.getWidth()*dimension;