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

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

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

origin: davemorrissey/subsampling-scale-image-view

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  // Don't draw pin before image is ready so it doesn't move around during setup.
  if (!isReady()) {
    return;
  }
  paint.setAntiAlias(true);
  if (sPin != null && pin != null) {
    sourceToViewCoord(sPin, vPin);
    float vX = vPin.x - (pin.getWidth()/2);
    float vY = vPin.y - pin.getHeight();
    canvas.drawBitmap(pin, vX, vY, paint);
  }
}
origin: davemorrissey/subsampling-scale-image-view

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  // Don't draw anything before image is ready.
  if (!isReady()) {
    return;
  }
  paint.setAntiAlias(true);
  if (sPoints != null && sPoints.size() >= 2) {
    vPath.reset();
    sourceToViewCoord(sPoints.get(0).x, sPoints.get(0).y, vPrev);
    vPath.moveTo(vPrev.x, vPrev.y);
    for (int i = 1; i < sPoints.size(); i++) {
      sourceToViewCoord(sPoints.get(i).x, sPoints.get(i).y, vPoint);
      vPath.quadTo(vPrev.x, vPrev.y, (vPoint.x + vPrev.x) / 2, (vPoint.y + vPrev.y) / 2);
      vPrev = vPoint;
    }
    paint.setStyle(Style.STROKE);
    paint.setStrokeCap(Cap.ROUND);
    paint.setStrokeWidth(strokeWidth * 2);
    paint.setColor(Color.BLACK);
    canvas.drawPath(vPath, paint);
    paint.setStrokeWidth(strokeWidth);
    paint.setColor(Color.argb(255, 51, 181, 229));
    canvas.drawPath(vPath, paint);
  }
}
origin: davemorrissey/subsampling-scale-image-view

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  // Don't draw pin before image is ready so it doesn't move around during setup.
  if (!isReady()) {
    return;
  }
  sCenter.set(getSWidth()/2, getSHeight()/2);
  sourceToViewCoord(sCenter, vCenter);
  float radius = (getScale() * getSWidth()) * 0.25f;
  paint.setAntiAlias(true);
  paint.setStyle(Style.STROKE);
  paint.setStrokeCap(Cap.ROUND);
  paint.setStrokeWidth(strokeWidth * 2);
  paint.setColor(Color.BLACK);
  canvas.drawCircle(vCenter.x, vCenter.y, radius, paint);
  paint.setStrokeWidth(strokeWidth);
  paint.setColor(Color.argb(255, 51, 181, 229));
  canvas.drawCircle(vCenter.x, vCenter.y, radius, paint);
}
origin: IndoorAtlas/android-sdk-examples

  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    if (!isReady()) {
      return;
    }

    if (dotCenter != null) {
      PointF vPoint = sourceToViewCoord(dotCenter);
      float scaledRadius = getScale() * radius;
      Paint paint = new Paint();
      paint.setAntiAlias(true);
      paint.setStyle(Paint.Style.FILL);
      paint.setColor(getResources().getColor(R.color.ia_blue));
      canvas.drawCircle(vPoint.x, vPoint.y, scaledRadius, paint);
    }
  }
}
origin: IndoorAtlas/android-sdk-examples

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  if (!isReady()) {
    Log.w(TAG, "drawing not yet ready, skipping drawing locations");
    return;
  }
  final float scaledRadius = getScale() * mRadius;
  Iterator<LocationEntry> iterator = mKnownLocations.values().iterator();
  while (iterator.hasNext()) {
    LocationEntry entry = iterator.next();
    final float scaledRadiusAccuracy = getScale() * (mRadius + entry.mAccuracy);
    sourceToViewCoord(entry.mPoint, mRecyclePoint);
    mDotPaint.setColor(entry.mSource.color);
    mTextPaint.setColor(entry.mSource.color);
    canvas.drawCircle(mRecyclePoint.x, mRecyclePoint.y, scaledRadius, mDotPaint);
    mDotPaintAccuracy.setColor(entry.mSource.color);
    mDotPaintAccuracy.setAlpha(50);
    canvas.drawCircle(mRecyclePoint.x, mRecyclePoint.y, scaledRadiusAccuracy, mDotPaintAccuracy);
    canvas.drawText(entry.mSource.name,
        mRecyclePoint.x + (scaledRadius * 1.2f),
        mRecyclePoint.y + (scaledRadius / 2),
        mTextPaint);
  }
}
origin: kollerlukas/Camera-Roll-Android-App

@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  // Don't draw anything before image is ready.
  if (!isReady() || cropRect == null) {
    return;
  }
  drawBackground(canvas);
  drawRect(canvas);
  drawCorners(canvas);
  if (touching) {
    drawGuidelines(canvas);
  }
}
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewonDraw

Javadoc

Draw method should not be called until the view has dimensions so the first calls are used as triggers to calculate the scaling and tiling required. Once the view is setup, tiles are displayed as they are loaded.

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>,
  • getCenter,
  • getContext,
  • getHeight,
  • getOrientation,
  • getScale,
  • isReady,
  • onImageLoaded

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • CodeWhisperer alternatives
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