Tabnine Logo
SubsamplingScaleImageView.getCenter
Code IndexAdd Tabnine to your IDE (free)

How to use
getCenter
method
in
com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView

Best Java code snippets using com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.getCenter (Showing top 13 results out of 315)

origin: davemorrissey/subsampling-scale-image-view

private AnimationBuilder(float scale) {
  this.targetScale = scale;
  this.targetSCenter = getCenter();
  this.vFocus = null;
}
origin: davemorrissey/subsampling-scale-image-view

/**
 * On resize, preserve center and scale. Various behaviours are possible, override this method to use another.
 */
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  debug("onSizeChanged %dx%d -> %dx%d", oldw, oldh, w, h);
  PointF sCenter = getCenter();
  if (readySent && sCenter != null) {
    this.anim = null;
    this.pendingScale = scale;
    this.sPendingCenter = sCenter;
  }
}
origin: davemorrissey/subsampling-scale-image-view

/**
 * Get the current state of the view (scale, center, orientation) for restoration after rotate. Will return null if
 * the view is not ready.
 * @return an {@link ImageViewState} instance representing the current position of the image. null if the view isn't ready.
 */
@Nullable
public final ImageViewState getState() {
  if (vTranslate != null && sWidth > 0 && sHeight > 0) {
    //noinspection ConstantConditions
    return new ImageViewState(getScale(), getCenter(), getOrientation());
  }
  return null;
}
origin: davemorrissey/subsampling-scale-image-view

private void sendStateChanged(float oldScale, PointF oldVTranslate, int origin) {
  if (onStateChangedListener != null && scale != oldScale) {
    onStateChangedListener.onScaleChanged(scale, origin);
  }
  if (onStateChangedListener != null && !vTranslate.equals(oldVTranslate)) {
    onStateChangedListener.onCenterChanged(getCenter(), origin);
  }
}
origin: davemorrissey/subsampling-scale-image-view

anim.time = System.currentTimeMillis();
anim.sCenterEndRequested = targetSCenter;
anim.sCenterStart = getCenter();
anim.sCenterEnd = targetSCenter;
anim.vFocusStart = sourceToViewCoord(targetSCenter);
origin: davemorrissey/subsampling-scale-image-view

canvas.drawText("Scale: " + String.format(Locale.ENGLISH, "%.2f", scale) + " (" + String.format(Locale.ENGLISH, "%.2f", minScale()) + " - " + String.format(Locale.ENGLISH, "%.2f", maxScale) + ")", px(5), px(15), debugTextPaint);
canvas.drawText("Translate: " + String.format(Locale.ENGLISH, "%.2f", vTranslate.x) + ":" + String.format(Locale.ENGLISH, "%.2f", vTranslate.y), px(5), px(30), debugTextPaint);
PointF center = getCenter();
origin: mozilla-tw/Rocket

private AnimationBuilder(float scale) {
  this.targetScale = scale;
  this.targetSCenter = getCenter();
  this.vFocus = null;
}
origin: mozilla-tw/Rocket

/**
 * On resize, preserve center and scale. Various behaviours are possible, override this method to use another.
 */
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
  debug("onSizeChanged %dx%d -> %dx%d", oldw, oldh, w, h);
  PointF sCenter = getCenter();
  if (readySent && sCenter != null) {
    this.anim = null;
    this.pendingScale = scale;
    this.sPendingCenter = sCenter;
  }
}
origin: mozilla-tw/Rocket

/**
 * Get the current state of the view (scale, center, orientation) for restoration after rotate. Will return null if
 * the view is not ready.
 */
public final ImageViewState getState() {
  if (vTranslate != null && sWidth > 0 && sHeight > 0) {
    return new ImageViewState(getScale(), getCenter(), getOrientation());
  }
  return null;
}
origin: mozilla-tw/Rocket

private void sendStateChanged(float oldScale, PointF oldVTranslate, int origin) {
  if (onStateChangedListener != null) {
    if (scale != oldScale) {
      onStateChangedListener.onScaleChanged(scale, origin);
    }
    if (!vTranslate.equals(oldVTranslate)) {
      onStateChangedListener.onCenterChanged(getCenter(), origin);
    }
  }
}
origin: kollerlukas/Camera-Roll-Android-App

private Rect getCroppedRect() {
  SubsamplingScaleImageView imageView = findViewById(R.id.imageView);
  PointF center = imageView.getCenter();
  if (center != null) {
    int left = (int) (center.x - imageView.getWidth() / 2);
    return new Rect(left, 0, imageView.getSWidth(), imageView.getSHeight());
  }
  return new Rect(0, 0, imageView.getSWidth(), imageView.getSHeight());
}
origin: mozilla-tw/Rocket

canvas.drawText("Scale: " + String.format(Locale.ENGLISH, "%.2f", scale), 5, 15, debugPaint);
canvas.drawText("Translate: " + String.format(Locale.ENGLISH, "%.2f", vTranslate.x) + ":" + String.format(Locale.ENGLISH, "%.2f", vTranslate.y), 5, 35, debugPaint);
PointF center = getCenter();
canvas.drawText("Source center: " + String.format(Locale.ENGLISH, "%.2f", center.x) + ":" + String.format(Locale.ENGLISH, "%.2f", center.y), 5, 55, debugPaint);
debugPaint.setStrokeWidth(2f);
origin: mozilla-tw/Rocket

anim.time = System.currentTimeMillis();
anim.sCenterEndRequested = targetSCenter;
anim.sCenterStart = getCenter();
anim.sCenterEnd = targetSCenter;
anim.vFocusStart = sourceToViewCoord(targetSCenter);
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewgetCenter

Javadoc

Returns the source point at the center of the view.

Popular methods of SubsamplingScaleImageView

  • setImage
    Set the image source from a bitmap, resource, asset, file or other URI, starting with a given orient
  • setDoubleTapZoomScale
    Set the scale the image will zoom in to when double tapped. This also the scale point where a double
  • setMaxScale
    Set the maximum scale allowed. A value of 1 means 1:1 pixels at maximum scale. You may wish to set t
  • setMinimumDpi
    This is a screen density aware alternative to #setMaxScale(float); it allows you to express the maxi
  • setScaleAndCenter
    Externally change the scale and translation of the source image. This may be used with getCenter() a
  • getWidth
  • setDoubleTapZoomDpi
    A density aware alternative to #setDoubleTapZoomScale(float); this allows you to express the scale t
  • setMinimumScaleType
    Set the minimum scale type. See static fields. Normally #SCALE_TYPE_CENTER_INSIDE is best, for image
  • setMinimumTileDpi
    By default, image tiles are at least as high resolution as the screen. For a retina screen this may
  • setPanEnabled
    Enable or disable pan gesture detection. Disabling pan causes the image to be centered.
  • setZoomEnabled
    Enable or disable zoom gesture detection. Disabling zoom locks the the current scale.
  • <init>
  • setZoomEnabled,
  • <init>,
  • getContext,
  • getHeight,
  • getOrientation,
  • getScale,
  • isReady,
  • onDraw,
  • onImageLoaded

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • JList (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now