android.graphics.Region.set()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中android.graphics.Region.set方法的一些代码示例,展示了Region.set的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Region.set方法的具体详情如下:
包路径:android.graphics.Region
类名称:Region
方法名:set

Region.set介绍

暂无

代码示例

代码示例来源:origin: ImmortalZ/StereoView

private boolean isContain(MotionEvent event) {
  rect.set(getPaddingLeft(), getPaddingTop(), getWidth() - getPaddingRight(), getHeight() - getPaddingBottom());
  region.set(rect);
  if (region.contains((int) event.getX(), (int) event.getY())) {
    return true;
  }
  return false;
}

代码示例来源:origin: facebook/litho

clipBoundsRegion.set(
  0,
  0,

代码示例来源:origin: crvv/android_wubi_input

mClipRegion.set(0, 0, width, height);
} else {
  mClipRegion.setEmpty();

代码示例来源:origin: pavel163/FilledView

private Path getRoundRectPath(float left, float top, float right, float bottom, float radius) {
  region.set((int) left, (int) top, (int) right, (int) bottom);
  Path roundRectPath = new Path();
  RectF rectF = new RectF();
  rectF.set(left + borderSize, top + borderSize, right - borderSize, bottom - borderSize);
  roundRectPath.addRoundRect(rectF, radius, radius, Path.Direction.CCW);
  region.setPath(roundRectPath, region);
  return region.getBoundaryPath();
}

代码示例来源:origin: moagrius/TileView

private void establishDirtyRegion() {
 mUnfilledRegion.set(mScaledViewport);
 // then punch holes in it for every decoded current tile
 // when drawing previous tiles, if there's no intersection with an unfilled area, it can be safely discarded
 // otherwise we should draw the previous tile
 for (Tile tile : mTilesVisibleInViewport) {
  if (tile.getState() == Tile.State.DECODED) {
   mUnfilledRegion.op(tile.getDrawingRect(), Region.Op.DIFFERENCE);
  }
 }
}

代码示例来源:origin: rakshakhegde/Diffre

@Override
public void computeCroppedProgressPath() {
  region.set(0, 0, (int) (width * percent), height);
  progressRegion.setPath(progressStrokePath, region); // INTERSECT
  textRegion.setPath(textPath, region);
  progressRegion.op(textRegion, Region.Op.DIFFERENCE); // DIFFERENCE
  croppedProgressPath.rewind();
  progressRegion.getBoundaryPath(croppedProgressPath);
}

代码示例来源:origin: THEONE10211024/ApiDemos

private void drawRgn(Canvas canvas, int color, String str, Region.Op op) {
  if (str != null) {
    mPaint.setColor(Color.BLACK);
    canvas.drawText(str, 80, 24, mPaint);
  }
  Region rgn = new Region();
  rgn.set(mRect1);
  rgn.op(mRect2, op);
  mPaint.setColor(color);
  RegionIterator iter = new RegionIterator(rgn);
  Rect r = new Rect();
  canvas.translate(0, 30);
  mPaint.setColor(color);
  while (iter.next(r)) {
    canvas.drawRect(r, mPaint);
  }
  drawOriginalRects(canvas, 0x80);
}

代码示例来源:origin: rakshakhegde/Diffre

@Override
  public void computeCroppedTextPath() {
    region.set((int) (width * percent), 0, width, height);
    textRegion.setPath(textPath, region); // INTERSECT
    croppedTextPath.rewind();
    textRegion.getBoundaryPath(croppedTextPath);
  }
}

代码示例来源:origin: qiubiteme/android_api_demos

private void drawRgn(Canvas canvas, int color, String str, Region.Op op) {
  if (str != null) {
    mPaint.setColor(Color.BLACK);
    canvas.drawText(str, 80, 24, mPaint);
  }
  Region rgn = new Region();
  rgn.set(mRect1);
  rgn.op(mRect2, op);
  mPaint.setColor(color);
  RegionIterator iter = new RegionIterator(rgn);
  Rect r = new Rect();
  canvas.translate(0, 30);
  mPaint.setColor(color);
  while (iter.next(r)) {
    canvas.drawRect(r, mPaint);
  }
  drawOriginalRects(canvas, 0x80);
}

代码示例来源:origin: pavel163/FilledView

public void computeCroppedTextPath() {
  if (startPosition == StartMode.RIGHT.getMode()) {
    region.set(0, 0, (int) (width * (1F - percent)), height);
  } else if (startPosition == StartMode.LEFT.getMode()) {
    region.set((int) (width * percent), 0, width, height);
  } else if (startPosition == StartMode.TOP.getMode()) {
    region.set(0, (int) (height * percent), width, height);
  } else if (startPosition == StartMode.BOTTOM.getMode()) {
    region.set(0, 0, width, (int) (height * (1F - percent)));
  }
  textRegion.setPath(textPath, region);
  croppedTextPath.rewind();
  textRegion.getBoundaryPath(croppedTextPath);
}

代码示例来源:origin: haibuzou/Calendar365

for (int j = 0; j < monthRegionsFour[i].length; j++) {
  Region region = new Region();
  region.set(j * cellW, i * cellH4, cellW + (j * cellW),
      cellW + (i * cellH4));
  monthRegionsFour[i][j] = region;
for (int j = 0; j < monthRegionsFive[i].length; j++) {
  Region region = new Region();
  region.set(j * cellW, i * cellH5, cellW + (j * cellW),
      cellW + (i * cellH5));
  monthRegionsFive[i][j] = region;
for (int j = 0; j < monthRegionsSix[i].length; j++) {
  Region region = new Region();
  region.set((j * cellW), (i * cellH6), cellW + (j * cellW),
      cellW + (i * cellH6));
  monthRegionsSix[i][j] = region;

代码示例来源:origin: pavel163/FilledView

public void computeCroppedProgressPath() {
  if (startPosition == StartMode.RIGHT.getMode()) {
    region.set((int) (width * (1F - percent)), 0, width, height);
  } else if (startPosition == StartMode.LEFT.getMode()) {
    region.set(0, 0, (int) (width * percent), height);
  } else if (startPosition == StartMode.TOP.getMode()) {
    region.set(0, 0, width, (int) (height * percent));
  } else if (startPosition == StartMode.BOTTOM.getMode()) {
    region.set(0, (int) (height * (1F - percent)), width, height);
  }
  region.setPath(progressStrokePath, region);
  textRegion.setPath(textPath, region);
  region.op(textRegion, Region.Op.DIFFERENCE);
  croppedProgressPath.rewind();
  region.getBoundaryPath(croppedProgressPath);
}

代码示例来源:origin: haibuzou/Calendar365

for (int j = 0; j < monthRegionsFour[i].length; j++) {
  Region region = new Region();
  region.set(j * cellW, i * cellH4, cellW + (j * cellW),
      cellW + (i * cellH4));
  monthRegionsFour[i][j] = region;
for (int j = 0; j < monthRegionsFive[i].length; j++) {
  Region region = new Region();
  region.set(j * cellW, i * cellH5, cellW + (j * cellW),
      cellW + (i * cellH5));
  monthRegionsFive[i][j] = region;
for (int j = 0; j < monthRegionsSix[i].length; j++) {
  Region region = new Region();
  region.set(j * cellW, i * cellH6, cellW + (j * cellW),
      cellW + (i * cellH6));
  monthRegionsSix[i][j] = region;

代码示例来源:origin: paradoxie/SignCalender

for (int j = 0; j < MONTH_REGIONS_4[i].length; j++) {
  Region region = new Region();
  region.set((j * cellW), (i * cellH4), cellW + (j * cellW),
      cellW + (i * cellH4));
  MONTH_REGIONS_4[i][j] = region;
for (int j = 0; j < MONTH_REGIONS_5[i].length; j++) {
  Region region = new Region();
  region.set((j * cellW), (i * cellH5), cellW + (j * cellW),
      cellW + (i * cellH5));
  MONTH_REGIONS_5[i][j] = region;
for (int j = 0; j < MONTH_REGIONS_6[i].length; j++) {
  Region region = new Region();
  region.set((j * cellW), (i * cellH6), cellW + (j * cellW),
      cellW + (i * cellH6));
  MONTH_REGIONS_6[i][j] = region;

代码示例来源:origin: crvv/android_wubi_input

outInsets.touchableRegion.set(touchLeft, touchTop, touchRight, touchBottom);

代码示例来源:origin: rkkr/simple-keyboard

outInsets.touchableRegion.set(touchLeft, touchTop, touchRight, touchBottom);

相关文章