gpt4 book ai didi

com.koolearn.klibrary.core.view.ZLPaintContext类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:05:53 28 4
gpt4 key购买 nike

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

ZLPaintContext介绍

暂无

代码示例

代码示例来源:origin: Jiangzqts/EpubRead

private final void drawString(ZLPaintContext context, int x, int y, char[] str, int offset, int length, ZLTextWord.Mark mark, ZLColor color, int shift) {
  if (mark == null) {
    context.setTextColor(color);
    context.drawString(x, y, str, offset, length);
  } else {
    LogUtil.i10("drawString");
        context.setTextColor(color);
        context.drawString(x, y, str, offset + pos, endPos - pos);
        x += context.getStringWidth(str, offset + pos, endPos - pos);
        context.setFillColor(getHighlightingBackgroundColor());
        int endPos = Math.min(markStart + markLen, length);
        final int endX = x + context.getStringWidth(str, offset + markStart, endPos - markStart);
        context.fillRectangle(x, y - context.getStringHeight(), endX - 1, y + context.getDescent());
        context.setTextColor(getHighlightingForegroundColor());
        context.drawString(x, y, str, offset + markStart, endPos - markStart);
        x = endX;
    if (pos < length) {
      LogUtil.i10("drawString");
      context.setTextColor(color);
      context.drawString(x, y, str, offset + pos, length - pos);

代码示例来源:origin: Jiangzqts/EpubRead

public static void draw(ZLPaintContext context, Which which, int x, int y, ZLColor color) {
    context.setFillColor(color);
    final int dpi = ZLibrary.Instance().getDisplayDPI();
    final int unit = dpi / 160;
    final int xCenter = which == Which.Left ? x - unit - 1 : x + unit + 1;
    context.fillRectangle(xCenter - unit, y + dpi / 10, xCenter + unit, y - dpi / 10);
    if (which == Which.Left) {
      context.fillCircle(xCenter, y - dpi / 10, unit * 4);
    } else {
      context.fillCircle(xCenter, y + dpi / 10, unit * 4);
    }
  }
}

代码示例来源:origin: ydcx/KooReader

public final int getCharHeight(char chr) {
  final Integer h = myCharHeights.get(chr);
  if (h != null) {
    return h;
  }
  final int he = getCharHeightInternal(chr);
  myCharHeights.put(chr, he);
  return he;
}

代码示例来源:origin: ydcx/KooReader

} else if (element instanceof ZLTextImageElement) {
  final ZLTextImageElement imageElement = (ZLTextImageElement) element;
  context.drawImage(
      areaX, areaY,
      imageElement.ImageData,
  context.setLineColor(getTextColor(ZLTextHyperlink.NO_LINK));
  context.setFillColor(new ZLColor(127, 127, 127));
  final int xStart = area.XStart + 10;
  final int xEnd = area.XEnd - 10;
  final int yStart = area.YStart + 10;
  final int yEnd = area.YEnd - 10;
  context.fillRectangle(xStart, yStart, xEnd, yEnd);
  context.drawLine(xStart, yStart, xStart, yEnd);
  context.drawLine(xStart, yEnd, xEnd, yEnd);
  context.drawLine(xEnd, yEnd, xEnd, yStart);
  context.drawLine(xEnd, yStart, xStart, yStart);
  final int l = xStart + (xEnd - xStart) * 7 / 16;
  final int r = xStart + (xEnd - xStart) * 10 / 16;
  final int b = yStart + (yEnd - yStart) * 4 / 6;
  final int c = yStart + (yEnd - yStart) / 2;
  context.setFillColor(new ZLColor(196, 196, 196));
  context.fillPolygon(new int[]{l, l, r}, new int[]{t, b, c});
} else if (element instanceof ExtensionElement) {
  ((ExtensionElement) element).draw(context, area);
} else if (element == ZLTextElement.HSpace || element == ZLTextElement.NBSpace) {
  final int cw = context.getSpaceWidth();
  for (int len = 0; len < area.XEnd - area.XStart; len += cw) {

代码示例来源:origin: Jiangzqts/EpubRead

context.setLineColor(color);
context.setFillColor(color, 0x33);
final int xStart = area.XStart + hMargin;
final int xEnd = area.XEnd - hMargin;
final int yStart = area.YStart + vMargin;
final int yEnd = area.YEnd - vMargin;
context.fillRectangle(xStart, yStart, xEnd, yEnd);
context.drawLine(xStart, yStart, xStart, yEnd);
context.drawLine(xStart, yEnd, xEnd, yEnd);
context.drawLine(xEnd, yEnd, xEnd, yStart);
context.drawLine(xEnd, yStart, xStart, yStart);

代码示例来源:origin: ydcx/KooReader

final ZLFile wallpaper = getWallpaperFile(); // 获取背景图片
if (wallpaper != null) {
  context.clear(wallpaper, getFillMode());
} else {
  context.clear(getBackgroundColor());
    context.setFillColor(bgColor, 128);
    mode |= Hull.DrawMode.Fill;
    context.setLineColor(outlineColor);
    mode |= Hull.DrawMode.Outline;
  context.setLineColor(getSelectionBackgroundColor());
  outlinedElementRegion.hull().draw(context, Hull.DrawMode.Outline);
drawSelectionCursor(context, page, SelectionCursor.Which.Right);
context.drawFooter(buildTimeString(), pagePositionPecReal(page));

代码示例来源:origin: Jiangzqts/EpubRead

context.fillPolygon(xs, ys);
context.drawOutline(xs, ys);

代码示例来源:origin: ydcx/KooReader

abstract public void drawString(int x, int y, char[] string, int offset, int length);

代码示例来源:origin: Jiangzqts/EpubRead

} else if (element instanceof ZLTextImageElement) {
  final ZLTextImageElement imageElement = (ZLTextImageElement) element;
  context.drawImage(
      areaX, areaY,
      imageElement.ImageData,
  context.setLineColor(getTextColor(ZLTextHyperlink.NO_LINK));
  context.setFillColor(new ZLColor(127, 127, 127));
  final int xStart = area.XStart + 10;
  final int xEnd = area.XEnd - 10;
  final int yStart = area.YStart + 10;
  final int yEnd = area.YEnd - 10;
  context.fillRectangle(xStart, yStart, xEnd, yEnd);
  context.drawLine(xStart, yStart, xStart, yEnd);
  context.drawLine(xStart, yEnd, xEnd, yEnd);
  context.drawLine(xEnd, yEnd, xEnd, yStart);
  context.drawLine(xEnd, yStart, xStart, yStart);
  final int l = xStart + (xEnd - xStart) * 7 / 16;
  final int r = xStart + (xEnd - xStart) * 10 / 16;
  final int b = yStart + (yEnd - yStart) * 4 / 6;
  final int c = yStart + (yEnd - yStart) / 2;
  context.setFillColor(new ZLColor(196, 196, 196));
  context.fillPolygon(new int[]{l, l, r}, new int[]{t, b, c});
} else if (element instanceof ExtensionElement) {
  ((ExtensionElement) element).draw(context, area);
} else if (element == ZLTextElement.HSpace || element == ZLTextElement.NBSpace) {
  final int cw = context.getSpaceWidth();
  for (int len = 0; len < area.XEnd - area.XStart; len += cw) {

代码示例来源:origin: ydcx/KooReader

context.setLineColor(color);
context.setFillColor(color, 0x33);
final int xStart = area.XStart + hMargin;
final int xEnd = area.XEnd - hMargin;
final int yStart = area.YStart + vMargin;
final int yEnd = area.YEnd - vMargin;
context.fillRectangle(xStart, yStart, xEnd, yEnd);
context.drawLine(xStart, yStart, xStart, yEnd);
context.drawLine(xStart, yEnd, xEnd, yEnd);
context.drawLine(xEnd, yEnd, xEnd, yStart);
context.drawLine(xEnd, yStart, xStart, yStart);

代码示例来源:origin: Jiangzqts/EpubRead

final ZLFile wallpaper = getWallpaperFile(); // 获取背景图片
if (wallpaper != null) {
  context.clear(wallpaper, getFillMode());
} else {
  context.clear(getBackgroundColor());
    context.setFillColor(bgColor, 128);
    mode |= Hull.DrawMode.Fill;
    context.setLineColor(outlineColor);
    mode |= Hull.DrawMode.Outline;
  context.setLineColor(getSelectionBackgroundColor());
  outlinedElementRegion.hull().draw(context, Hull.DrawMode.Outline);
drawSelectionCursor(context, page, SelectionCursor.Which.Right);
context.drawFooter(buildTimeString(), pagePositionPecReal(page));

代码示例来源:origin: ydcx/KooReader

context.fillPolygon(xs, ys);
context.drawOutline(xs, ys);

代码示例来源:origin: Jiangzqts/EpubRead

abstract public void drawString(int x, int y, char[] string, int offset, int length);

代码示例来源:origin: ydcx/KooReader

private final void drawString(ZLPaintContext context, int x, int y, char[] str, int offset, int length, ZLTextWord.Mark mark, ZLColor color, int shift) {
  if (mark == null) {
    context.setTextColor(color);
    context.drawString(x, y, str, offset, length);
  } else {
    LogUtil.i10("drawString");
        context.setTextColor(color);
        context.drawString(x, y, str, offset + pos, endPos - pos);
        x += context.getStringWidth(str, offset + pos, endPos - pos);
        context.setFillColor(getHighlightingBackgroundColor());
        int endPos = Math.min(markStart + markLen, length);
        final int endX = x + context.getStringWidth(str, offset + markStart, endPos - markStart);
        context.fillRectangle(x, y - context.getStringHeight(), endX - 1, y + context.getDescent());
        context.setTextColor(getHighlightingForegroundColor());
        context.drawString(x, y, str, offset + markStart, endPos - markStart);
        x = endX;
    if (pos < length) {
      LogUtil.i10("drawString");
      context.setTextColor(color);
      context.drawString(x, y, str, offset + pos, length - pos);

代码示例来源:origin: ydcx/KooReader

public static void draw(ZLPaintContext context, Which which, int x, int y, ZLColor color) {
    context.setFillColor(color);
    final int dpi = ZLibrary.Instance().getDisplayDPI();
    final int unit = dpi / 160;
    final int xCenter = which == Which.Left ? x - unit - 1 : x + unit + 1;
    context.fillRectangle(xCenter - unit, y + dpi / 10, xCenter + unit, y - dpi / 10);
    if (which == Which.Left) {
      context.fillCircle(xCenter, y - dpi / 10, unit * 4);
    } else {
      context.fillCircle(xCenter, y + dpi / 10, unit * 4);
    }
  }
}

代码示例来源:origin: Jiangzqts/EpubRead

public final int getCharHeight(char chr) {
  final Integer h = myCharHeights.get(chr);
  if (h != null) {
    return h;
  }
  final int he = getCharHeightInternal(chr);
  myCharHeights.put(chr, he);
  return he;
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com