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.
カスタムビューで、キャンバス上の特定のポイントにドローアブルの中心を設定する方法はありますか?(私はドローアブルの長方形の境界を理解することに対処したくありません...)
ビットマップを描画するための呼び出しを行うときは、左側と上部の属性がそれぞれ画像の幅と高さの半分を引いた位置に設定されたポイントに描画します。それはあなたが望むポイントにそれを集中させます。
IE。
canvas.drawBitmap(bitmap, xPos - bitmap.getWidth()/2, yPos - bitmap.getHeight()/2, new Paint());