drawCirlce

@param mixed $canvas
@param mixed $w
@param mixed $h
@param mixed $r
@param mixed $g
@param mixed $b
@param mixed $opc
@param mixed $cirle
@access protected
@return mixed
181431
protected function drawCirlce($canvas, $w, $h, $r, $g, $b, $opc, $cirle = true)
    {

        $centerX     = floor($w / 2);
        $centerY     = floor($h / 2);

        if ($cirle) {
            $w = $h = min($w, $h);
        }

        $offset = 2 * $this->getOption('o', 1);

        $xa         = ($w - $offset) / 2;
        $xb         = ($h - $offset) / 2;
        $thickness = 2.5 / min($xa, $xb);

        $color  = imagecolorallocatealpha($canvas, $r, $g, $b, $opc);
        $maxTransparency = 127;


        for ($x = 0; $x <= $xa + 1; $x++) {
            for ($y = 0; $y <= $xb + 1; $y++) {

                // implicit formula: 1 = $x*$x/($a*$a) + $y*$y/($b*$b)
                $one = $x*$x/($xa*$xa) + $y*$y/($xb*$xb);
                $bound = ($one - 1) / $thickness;

                if ($bound > 1) {
                    break;
                }
                $transparency = round(abs($bound) * $maxTransparency);
                $alpha        = $bound < -($thickness)  ? $color : $color | ($transparency << 24);

                // draw circle
                imagesetpixel($canvas, $centerX + $x, $centerY + $y, $alpha);
                imagesetpixel($canvas, $centerX - $x, $centerY + $y, $alpha);
                imagesetpixel($canvas, $centerX - $x, $centerY - $y, $alpha);
                imagesetpixel($canvas, $centerX + $x, $centerY - $y, $alpha);
            }
        }

        return $canvas;
    }
752626
function filled_rectangle($x1, $y1, $w, $h, $color, $blend = "Normal", $opacity = 1.0) {
		//var_dump($color);
		//Helpers::dompdf_debug("trace", "($x1, $y1, $w, $h, [$color[0], $color[1], $color[2]], $blend, $opacity)");

		//$this->_set_stroke_color($color);
		//$this->_set_fill_color($color);
		//$this->_set_line_style(1, "square", "miter", array());
		$this->_set_line_transparency($blend, $opacity);
		$this->_set_fill_transparency($blend, $opacity);

		$this->_pdf->Rect($x1, $y1, $w, $h, 'F', $this->_make_line_style($color, 1, "square", "miter", array()), $this->_get_rgb($color)); //***

	}
630765
void draw(Canvas canvas) {
        mCanvasRect.set(0.0f, 0.0f, canvas.getWidth(), canvas.getHeight());
        switch (mShape) {
            case SHAPE_RECTANGLE:
                canvas.drawRect(mCanvasRect, mCanvasPaint);
                break;
            case SHAPE_OVAL:
                canvas.drawOval(mCanvasRect, mCanvasPaint);
                break;
            case SHAPE_STAR_3_VERTICES:
            case SHAPE_STAR_4_VERTICES:
            case SHAPE_STAR_5_VERTICES:
            case SHAPE_STAR_6_VERTICES:
                drawStar(canvas, mShape);
                break;
            case SHAPE_HEART:
                drawHeart(canvas);
                break;
        }
    }
757066
public function draw(int $from = 5): void
	{
		$dots = 0;

		$fromLength = strlen($from);

		$totalLength = $fromLength + 5;

		do
		{
			do
			{
				$numbers = str_pad($from, $fromLength, '0', STR_PAD_LEFT);

				$this->output->write("\r" . str_pad($numbers . ' ' . str_repeat('.', $dots) . ' ', $totalLength, ' '));

				$this->sleep();
			}
			while($dots++ < 3);

			$dots = 0;
		}
		while($from-- > 1);

		$this->output->write("\r" . str_repeat(' ', $totalLength) . "\r");
	}
669211
def draw_rectangle(x, y, width, height, attr = {})
            load!

            stroke_color  = attr.fetch(:stroke_color, DEFAULT_STROKE_COLOR)
            fill_color    = attr.fetch(:fill_color, DEFAULT_FILL_COLOR)
            line_cap      = attr.fetch(:line_cap, DEFAULT_LINECAP)
            line_join     = attr.fetch(:line_join, DEFAULT_LINEJOIN)
            line_width    = attr.fetch(:line_width, DEFAULT_LINEWIDTH)
            dash_pattern  = attr.fetch(:dash, DEFAULT_DASHPATTERN)

            stroke        = attr[:stroke].nil? ? true : attr[:stroke]
            fill          = attr[:fill].nil? ? false : attr[:fill]

            stroke = true if fill == false and stroke == false

            set_fill_color(fill_color) if fill
            set_stroke_color(stroke_color) if stroke
            set_line_width(line_width)
            set_line_cap(line_cap)
            set_line_join(line_join)
            set_dash_pattern(dash_pattern)

            if @canvas.gs.text_state.is_in_text_object?
                @instructions << PDF::Instruction.new('ET').render(@canvas)
            end

            @instructions << PDF::Instruction.new('re', x,y,width,height).render(@canvas)

            @instructions << (i =
                if stroke and not fill
                    PDF::Instruction.new('S')
                elsif fill and not stroke
                    PDF::Instruction.new('f')
                elsif fill and stroke
                    PDF::Instruction.new('B')
                end
            )

            i.render(@canvas)

            self
        end
657134
private function drawPoiRectangle($poi, $color, $borderSize, $imageWidth, $imageHeight) {
        $rect = new ImagickDraw();
        $rect->setStrokeColor($color);
        $rect->setFillColor($color);
        $rect->setStrokeAntialias(false);

        $x1 = max(0, $poi['x'] - $borderSize);
        $x2 = min($imageWidth, $poi['x'] + $poi['width'] + $borderSize);

        // Left
        $rect->rectangle(
            $x1,
            $poi['y'],
            $poi['x'],
            $poi['y'] + $poi['height']
        );

        // Right
        $rect->rectangle(
            $poi['x'] + $poi['width'],
            $poi['y'],
            $x2,
            $poi['y'] + $poi['height']
        );

        // Top
        $rect->rectangle(
            $x1,
            max(0, $poi['y'] - $borderSize),
            $x2,
            $poi['y']
        );

        // Bottom
        $rect->rectangle(
            $x1,
            $poi['y'] + $poi['height'],
            $x2,
            min($imageHeight, $poi['y'] + $poi['height'] + $borderSize)
        );

        // Draw the rectangle
        $this->imagick->drawImage($rect);
    }
136632
public void drawStartRectangle(Double width) {
		GraphicsContext vectorContext = mapWidget.getVectorContext();
		vectorContext.drawRectangle(group, MAP_AREA, 
				applyMargins(new Bbox(0, 0, width, getHeight())), 
				// IE9 does not draw an empty shapestyle (new ShapeStyle()), but it does draw one with opacity = 0...
				new ShapeStyle("#FF0000", 0, "#FF0000", 0, 1)); 
//				new ShapeStyle("#FF0000", 0.1f, "#FF0000", 0.5f, 1));
		vectorContext.setCursor(group, MAP_AREA, Cursor.POINTER.getValue());
	}
564390
public void drawRect(int x, int y, int w, int h, Color c) {
        int color = c.getRGB();
        for (int i = x; i < x + w; i++) {
            setIntColor(i, y, color);
            setIntColor(i, y + (h - 1), color);
        }

        for (int i = y; i < y + h; i++) {
            setIntColor(x, i, color);
            setIntColor(x + (w - 1), i, color);
        }
    }
491567
public function draw($im) {
        // Starting *
        $this->drawChar($im, $this->code[$this->starting], true);
        $c = count($this->data);
        for ($i = 0; $i < $c; $i++) {
            $this->drawChar($im, $this->data[$i], true);
        }

        // Checksum
        $c = count($this->checksumValue);
        for ($i = 0; $i < $c; $i++) {
            $this->drawChar($im, $this->code[$this->checksumValue[$i]], true);
        }

        // Ending *
        $this->drawChar($im, $this->code[$this->ending], true);

        // Draw a Final Bar
        $this->drawChar($im, '0', true);
        $this->drawText($im, 0, 0, $this->positionX, $this->thickness);
    }
767660
private void drawRipple(Canvas canvas) {
		canvas.save();
		canvas.clipPath(getCircleClipPath(), Region.Op.INTERSECT);
		TouchPoint point = getActionButton().getTouchPoint();
		canvas.drawCircle(point.getLastX(), point.getLastY(), currentRadius, getPreparedPaint());
		canvas.restore();
	}
1264896
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius, int clearColor) {
        clearBitmap(dest, clearColor);
        Canvas canvas = new Canvas(dest);

        Rect sourceRect = WorkCache.RECT1.get();
        Rect destRect = WorkCache.RECT2.get();
        sourceRect.set(0, 0, src.getWidth(), src.getHeight());
        destRect.set(0, 0, dest.getWidth(), dest.getHeight());

        RectF roundRect = WorkCache.RECTF1.get();
        roundRect.set(0, 0, dest.getWidth(), dest.getHeight());

        Paint paint = WorkCache.PAINT.get();
        paint.reset();
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(Color.RED);
        paint.setAntiAlias(true);
        canvas.drawRoundRect(roundRect, radius, radius, paint);

        paint.reset();
        paint.setFilterBitmap(true);
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
        canvas.drawBitmap(src, sourceRect, destRect, paint);

        canvas.setBitmap(null);
    }
1058099
def _draw(self, context, opacity):
        """"""

        # if we have been moved around, we should update bounds
        fresh_draw = len(self.__new_instructions or []) > 0
        if fresh_draw: #new stuff!
            self.paths = []
            self.__instruction_cache = self.__new_instructions
            self.__new_instructions = []
        else:
            if not self.__instruction_cache:
                return

        for instruction, args in self.__instruction_cache:
            if fresh_draw:
                if instruction in ("new_path", "stroke", "fill", "clip"):
                    self.paths.append((instruction, "path", context.copy_path()))

                elif instruction in ("save", "restore", "translate", "scale", "rotate"):
                    self.paths.append((instruction, "transform", args))

            if instruction == "set_color":
                self._set_color(context, args[0], args[1], args[2], args[3] * opacity)
            elif instruction == "show_layout":
                self._show_layout(context, *args)
            elif opacity < 1 and instruction == "paint":
                context.paint_with_alpha(opacity)
            else:
                getattr(context, instruction)(*args)
480163
protected function _drawCurve($pt, $color)
    {
        $this->pdf->SetFillColorArray($color);

        if (count($pt) == 10) {
            $this->pdf->drawCurve($pt[0], $pt[1], $pt[2], $pt[3], $pt[4], $pt[5], $pt[6], $pt[7], $pt[8], $pt[9]);
        } else {
            $this->pdf->drawCorner($pt[0], $pt[1], $pt[2], $pt[3], $pt[4], $pt[5], $pt[6], $pt[7]);
        }
    }
931690
function(polygon, options) {
        // Create new canvas where the polygon should be drawn
        this._drawOnCanvasContext(options, function(g) {
            options = options || {};
            g.beginPath();
            for (var i = 0; i < polygon.length; i++) {
                var ring = this._simplify(polygon[i]);
                if (ring && ring.length) {
                    var clockwise = (i === 0);
                    if (GeometryUtils.isClockwise(ring) !== !!clockwise) {
                        ring.reverse();
                    }
                }
                this._trace(g, ring);
            }
            g.closePath();
            this._setFillStyles(g, options);
            g.fill();
            this._setStrokeStyles(g, options);
            g.stroke();
            return true;
        });
    }
402323
function drawSwatchRect(top, left, width, height, name, color) {
  var layer = doc.layers[0];

  var rect = layer.pathItems.rectangle(top, left, width, height);
  rect.filled = true;
  rect.fillColor = color;
  rect.stroked = false;

  var textBounds = layer.pathItems.rectangle(top - height * config.swatchRect.textPosition, left + width * config.swatchRect.textPosition, width * (1 - config.swatchRect.textPosition * 2), height * (1 - config.swatchRect.textPosition * 2));
  var text = layer.textFrames.areaText(textBounds);
  text.contents = name + '\n' + colorToString(color);

  charStyles['swatchRectTitle'].applyTo(text.textRange);

  return rect;
}
1339049
function Conrec(drawContour) {
    if (!drawContour) {
      var c = this;
      c.contours = {};
      /**
       * drawContour - interface for implementing the user supplied method to
       * render the countours.
       *
       * Draws a line between the start and end coordinates.
       *
       * @param startX    - start coordinate for X
       * @param startY    - start coordinate for Y
       * @param endX      - end coordinate for X
       * @param endY      - end coordinate for Y
       * @param contourLevel - Contour level for line.
       */
      this.drawContour = function(startX, startY, endX, endY, contourLevel, k) {
        var cb = c.contours[k];
        if (!cb) {
          cb = c.contours[k] = new ContourBuilder(contourLevel);
        }
        cb.addSegment({x: startX, y: startY}, {x: endX, y: endY});
      }
      this.contourList = function() {
        var l = [];
        var a = c.contours;
        for (var k in a) {
          var s = a[k].s;
          var level = a[k].level;
          while (s) {
            var h = s.head;
            var l2 = [];
            l2.level = level;
            l2.k = k;
            while (h && h.p) {
              l2.push(h.p);
              h = h.next;
            }
            l.push(l2);
            s = s.next;
          }
        }
        l.sort(function(a, b) { return a.k - b.k });
        return l;
      }
    } else {
      this.drawContour = drawContour;
    }
    this.h  = new Array(5);
    this.sh = new Array(5);
    this.xh = new Array(5);
    this.yh = new Array(5);
  }
708448
public function drawCell($w, $h = 0, $txt = '', $implied_styles = "PBF", $ln = 0, $align = '', $valign = "T", $link = '')
    {
        // If a cell contains a line break like a "<BR>" then convert it to new line
        $txt = preg_replace("/<BR>/i", "\n", $txt);
        // Calculate cell height as string width divided by width
        $str_width = $this->document->GetStringWidth($txt);
        $numlines = ceil($this->document->GetStringWidth($txt) / ($w - 1));
        $numlines = $this->document->NbLines($w, $txt);
        $cellheight = ceil($numlines * $h);

        if ($this->draw_mode == "CALCULATE") {
            if ($cellheight > $this->calculated_line_height) {
                $this->calculated_line_height = $cellheight;
            }

        }

        // Add padding
        $toppad = 0;
        $bottompad = 0;
        if (strstr($implied_styles, "P")) {
            $padding = end($this->stylestack["padding"]);
            $toppad = $padding[0];
            $bottompad = $padding[2];
        }

        $fill = false;
        if (strstr($implied_styles, "F")) {
            // Add border and bg color
            $fill = end($this->stylestack["isfilling"]);
        }

        $borderwidth = false;
        if (strstr($implied_styles, "B")) {
            $borderwidth = end($this->stylestack["border-width"]);
            $border = end($this->stylestack["border-style"]);
            if ($border != "none") {
                $border = 1;
            } else {
                $borderwidth = "false";
            }

        }

        // Store current position so we can jump back after cell draw
        $y = $this->document->GetY();

        // To cater for multiline values, jump to bottom of line + padding -
        // cell height
        if ($valign == "T") {
            $jumpy = $toppad;
        } else if ($valign == "B") {
            $jumpy = $toppad + $this->calculated_line_height - $cellheight;
        } else if ($valign == "C") {
            $jumpy = (($toppad + $this->calculated_line_height + $bottompad) - $cellheight) / 2;
        }

        if ($this->draw_mode == "CALCULATE") {
            $fill_line_height = $toppad + $this->calculated_line_height + $bottompad;
            if ($this->max_line_height < $fill_line_height) {
                $this->max_line_height = $fill_line_height;
            }

            return;
        }

        if ($toppad) {
            $tmpborder = "";
            if (preg_match("/T/", $borderwidth)) {
                $tmpborder = preg_replace("/B/", "", $borderwidth);
                $borderwidth = preg_replace("/T/", "", $borderwidth);
            }

            $prevx = $this->document->GetX();
            $this->document->MultiCell($w, $toppad, "", $tmpborder, $align, $fill, $link);
            $this->setPosition($prevx, false);
        }

        if ($bottompad) {
            $tmpborder = "";
            if (preg_match("/B/", $borderwidth)) {
                $tmpborder = preg_replace("/T/", "", $borderwidth);
                $borderwidth = preg_replace("/B/", "", $borderwidth);
            }

            $prevx = $this->document->GetX();
            $this->document->MultiCell($w, $h + $bottompad, "", $tmpborder, $align, $fill, $link);
            $this->setPosition($prevx, false);
        }

        $this->setPosition(false, $y + $jumpy);

        // Link in a PDF must include a full URL contain http:// element
        // drilldown link of web url can be relative .. so prepend required elements
        if ($link) {
            if (!preg_match("/^http:\/\//", $link) && !preg_match("/^\//", $link)) {
                $link = "http://" . $_SERVER["HTTP_HOST"] . dirname($this->query->url_path_to_reportico_runner) . "/" . $link;
            }

            if (preg_match("/^\//", $link)) {
                $link = ReporticoApp::getConfig("http_urlhost"). "/" . $link;
            }

        }
        $this->document->MultiCell($w, $h, $txt, $borderwidth, $align, $fill, $link);
        $cell_height = $this->document->GetY() - $y;

        if ($cell_height > $this->current_line_height) {
            $this->current_line_height = $cell_height;
        }

        // Jump back
        $this->setPosition(false, $y);
    }