本文整理了Java中android.widget.ImageView.getScaleY()
方法的一些代码示例,展示了ImageView.getScaleY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getScaleY()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getScaleY
暂无
代码示例来源:origin: stackoverflow.com
public Bitmap mergeBitmaps() {
Bitmap baseBitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
Bitmap mergedBitmap = Bitmap.createBitmap(baseBitmap.getWidth(), baseBitmap.getHeight(), baseBitmap.getConfig());
Canvas canvas = new Canvas(mergedBitmap);
canvas.drawBitmap(baseBitmap, new Matrix(), null);
for (ImageView sticker: stickers) {
float viewSizeRatio = (float) sticker.getWidth() / image.getWidth();
float bitmapSizeRatio = (float) sticker.getDrawable().getBounds().width() / image.getDrawable().getBounds().width();
float ratioFactor = viewSizeRatio / bitmapSizeRatio;
float deltaX = sticker.getTranslationX()* ratioFactor;
float deltaY = sticker.getTranslationY()* ratioFactor;
float scaleX = sticker.getScaleX()* ratioFactor;
float scaleY = sticker.getScaleY()* ratioFactor;
float rotation = sticker.getRotation();
Matrix matrix = new Matrix();
matrix.postScale(scaleX, scaleY);
matrix.postRotate(rotation);
matrix.postTranslate(deltaX, deltaY);
Bitmap stickerBitmap = ((BitmapDrawable) sticker.getDrawable()).getBitmap();
canvas.drawBitmap(stickerBitmap, matrix, null);
}
return mergedBitmap;
}
代码示例来源:origin: marzika/Snapprefs
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (XposedHelpers.getAdditionalInstanceField(param.thisObject, "scale") == null)
XposedHelpers.setAdditionalInstanceField(param.thisObject, "scale", 1.0F);
ImageView previevStickerView = (ImageView) XposedHelpers.getObjectField(param.thisObject, "f");
float diff = previevStickerView.getScaleY() - (float) XposedHelpers.getAdditionalInstanceField(param.thisObject, "scale");
if (diff > .5F && !isResizing) {
XposedHelpers.setAdditionalInstanceField(param.thisObject, "scale", previevStickerView.getScaleY());
byte[] bArr = null;
try{
Object aet = XposedHelpers.getObjectField(param.thisObject, "k");
Object agm = XposedHelpers.getObjectField(aet, "f");
String svgfile = XposedHelpers.callMethod(aet, "b", XposedHelpers.getObjectField(param.thisObject, "l"))+".svg";
Logger.printMessage("SVGFILE: " + svgfile, LogType.DEBUG);
bArr = (byte[]) XposedHelpers.callMethod(agm, "a", XposedHelpers.callMethod(aet, "b", XposedHelpers.getObjectField(param.thisObject, "l"))+".svg");
}catch (NoSuchMethodError | NoSuchFieldError e2){
Logger.log("Scaling non-emoji sticker", true);
return;
}
Object gz = newInstance(findClass(Obfuscator.stickers.SVG_CLASS, lpparam.classLoader));//new. hc
Object svg = XposedHelpers.callMethod(gz, "a", new ByteArrayInputStream(bArr));//new.
Bitmap emoji = Bitmap.createBitmap((int) (previevStickerView.getHeight() * previevStickerView.getScaleY()), (int) (previevStickerView.getHeight() * previevStickerView.getScaleY()), Bitmap.Config.ARGB_8888);
new ResizeTask(previevStickerView, svg, emoji).execute();
}
}
});
代码示例来源:origin: stackoverflow.com
imageView.setScaleY(imageView.getScaleY() + zoomFactor);
代码示例来源:origin: stackoverflow.com
float y =img.getScaleY();
img.setScaleX((float) (x+1));
img.setScaleY((float) (y+1));
float y =img.getScaleY();
img.setScaleX((float) (x-1));
img.setScaleY((float) (y-1));
代码示例来源:origin: stackoverflow.com
private ScrollPane addMapScroll() {
ScrollPane mapScroll = new ScrollPane();
ImageView mapViewO = addMapView();
mapScroll.setContent(new Group(mapViewO));
mapScroll.setPannable(true);
mapScroll.setVbarPolicy(ScrollBarPolicy.NEVER);
mapScroll.setHbarPolicy(ScrollBarPolicy.NEVER);
mapScroll.addEventFilter(ScrollEvent.ANY, e -> {
e.consume();
if (e.getDeltaY() == 0) {
return;
}
double scaleFactor
= (e.getDeltaY() > 0)
? SCALE_DELTA
: 1 / SCALE_DELTA;
if (scaleFactor * SCALE_TOTAL >= 1) {
mapViewO.setScaleX(mapViewO.getScaleX() * scaleFactor);
mapViewO.setScaleY(mapViewO.getScaleY() * scaleFactor);
SCALE_TOTAL *= scaleFactor;
}
});
return mapScroll;
}
内容来源于网络,如有侵权,请联系作者删除!