Mark a circle on the current image
19025
def mark(x,y,label=None):
	""""""
	if label is not None: 
	    os.system("xpaset -p ds9 regions color red ")
	    cmd="echo 'image; text %d %d # text={%s}' | xpaset ds9 regions " % ( x,y,label) 
	else:
	    os.system("xpaset -p ds9 regions color blue")
	    cmd="echo 'image; circle %d %d 10 ' | xpaset ds9 regions " % (x,y)
	os.system(cmd)
	return
1300882
protected void setCurrentUserLedImage(final BufferedImage CURRENT_USER_LED_IMAGE) {
        if (currentUserLedImage != null) {
            currentUserLedImage.flush();
        }
        currentUserLedImage = CURRENT_USER_LED_IMAGE;
        repaint(getInnerBounds());
    }
1222242
def blit(self, image, x, y):
        """"""
        # adjust the position with the local bbox
        x += self.font_bbox[2] - self.bbox[2]
        y += self.font_bbox[3] - self.bbox[3]
        x += self.font_bbox[0] - self.bbox[0]
        y += self.font_bbox[1] - self.bbox[1]
        image[y:y+self.height, x:x+self.width] = self.bitmap * 255
332251
def create_pointing(self,event):
        """"""

        import math
        (ra,dec)=self.c2p((self.canvasx(event.x),
                           self.canvasy(event.y)))
        this_camera=camera(camera=self.camera.get())
        ccds=this_camera.getGeometry(ra,dec)
        items=[]
        for ccd in ccds:
            (x1,y1)=self.p2c((ccd[0],ccd[1]))
            (x2,y2)=self.p2c((ccd[2],ccd[3]))
            item=self.create_rectangle(x1,y1,x2,y2)
            items.append(item)
	label={}
	label['text']=w.plabel.get()
	label['id']=self.label(this_camera.ra,this_camera.dec,label['text'])
        self.pointings.append({
		"label": label,
		"items": items,
		"camera": this_camera} )
        self.current_pointing(len(self.pointings)-1)
656856
function(evt) {
    if (!this._measureDrag) {
      this._measureDrag = L.circleMarker(evt.latlng, this._symbols.getSymbol('measureDrag')).addTo(
        this._layer
      );
    } else {
      this._measureDrag.setLatLng(evt.latlng);
    }
    this._measureDrag.bringToFront();
  }
936373
def draw(self, img, pixmapper, bounds):
        ''''''

        if self.hidden:
            return

        if self.trail is not None:
            self.trail.draw(img, pixmapper, bounds)

        icon = self.img()
        (px,py) = pixmapper(self.latlon)

        # find top left
        (w, h) = image_shape(icon)
        px -= w//2
        py -= h//2

        (px, py, sx, sy, w, h) = self.clip(px, py, w, h, img)

        img[py:py + h, px:px + w] = cv2.add(img[py:py+h, px:px+w], icon[sy:sy+h, sx:sx+w])

        if self.label is not None:
            cv2.putText(img, self.label, (px,py), cv2.FONT_HERSHEY_SIMPLEX, 1.0, self.colour)
        
        # remember where we placed it for clicked()
        self.posx = px+w//2
        self.posy = py+h//2
1208432
function(canvas, shape, type, pe, unitX, unitY, size, source, sw, filled)
	{
		var funct = mxMarker.markers[type];
		
		return (funct != null) ? funct(canvas, shape, type, pe, unitX, unitY, size, source, sw, filled) : null;
	}
1356191
private void updateImage() {
		if (!over) {
			currentImage = normalImage;
			currentColor = normalColor;
			state = NORMAL;
			mouseUp = false;
		} else {
			if (mouseDown) {
				if ((state != MOUSE_DOWN) && (mouseUp)) {
					if (mouseDownSound != null) {
						mouseDownSound.play();
					}
					currentImage = mouseDownImage;
					currentColor = mouseDownColor;
					state = MOUSE_DOWN;
					
					notifyListeners();
					mouseUp = false;
				}
				
				return;
			} else {
				mouseUp = true;
				if (state != MOUSE_OVER) {
					if (mouseOverSound != null) {
						mouseOverSound.play();
					}
					currentImage = mouseOverImage;
					currentColor = mouseOverColor;
					state = MOUSE_OVER;
				}
			}
		}

		mouseDown = false;
		state = NORMAL;
	}
1039016
public void setCircleStrokeColor(@ColorInt int color) {
    jsonObject.addProperty(CircleOptions.PROPERTY_CIRCLE_STROKE_COLOR, ColorUtils.colorToRgbaString(color));
  }
1362358
def modify_colorpoint(self, n, position=0.5, color1=[1.0,1.0,1.0], color2=[1.0,1.0,1.0]):
        
        if    n==0.0                         : position = 0.0
        elif  n==len(self._colorpoint_list)-1: position = 1.0
        else: position = max(self._colorpoint_list[n-1][0], position)

        self._colorpoint_list[n] = [position, color1, color2]
        self.update_image()
        self.save_colormap("Last Used")
869243
function() {
        if (this.drawing) {
        this.ctx.beginPath();
        this.ctx.moveTo(this.lastPos.x, this.lastPos.y);
        this.ctx.lineTo(this.currentPos.x, this.currentPos.y);
        this.ctx.stroke();
        this.lastPos = this.currentPos;
      }
    }
703145
function drawMarker(image, color, zoom) {
        var canvas = document.createElement('canvas');
        var imageSize = options.getMarkerSize(zoom);
        var diameter = Math.min(imageSize.x, imageSize.y);
        canvas.width = diameter;
        canvas.height = diameter;
        var lineWidth = diameter / 10;
        var context = canvas.getContext('2d');
        var centerX = canvas.width / 2;
        var centerY = canvas.height / 2;
        var radius = diameter / 2 - lineWidth;

        context.beginPath();
        context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
        context.fillStyle = color;
        context.fill();
        context.lineWidth = lineWidth;
        context.strokeStyle = 'gray';
        context.stroke();

        // var iconWidth = canvas.width;
        // var iconHeight = canvas.height;
        var iconWidth = image.width;
        var iconHeight = image.height;
        context.drawImage(image, 0, 0, image.width, image.height, //
        (canvas.width - iconWidth) / 2, (canvas.height - iconHeight) / 2,
                iconWidth, iconHeight);
        return canvas;
    }
748799
def tickmark(self, x, y, size=10, orientation=90):
        """"""

        (x1, y1) = self.p2c([x, y])
        x2 = x1 + size * math.cos(math.radians(orientation))
        y2 = y1 - size * math.sin(math.radians(orientation))
        self.create_line(x1, y1, x2, y2)
523937
void updateRadius() {
		if (isPressed() && currentShadowRadius < getMaxShadowRadius()) {
			currentShadowRadius += SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed() && currentShadowRadius > getMinShadowRadius()) {
			currentShadowRadius -= SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed()){
			currentShadowRadius = getActionButton().getShadowRadius();
		}
		LOGGER.trace("Updated Shadow Responsive Effect current radius to: {}", currentShadowRadius);
	}
369477
function(width, height) {
									var newImage = svgCanvas.addSvgElementFromJson({
										element: 'image',
										attr: {
											x: 0,
											y: 0,
											width: width,
											height: height,
											id: svgCanvas.getNextId(),
											style: 'pointer-events:inherit'
										}
									});
									svgCanvas.setHref(newImage, e.target.result);
									svgCanvas.selectOnly([newImage]);
									svgCanvas.alignSelectedElements('m', 'page');
									svgCanvas.alignSelectedElements('c', 'page');
									updateContextPanel();
								}
1301507
def mouseMoveEvent(self, ev):
        """"""
        pos = self.transformPos(ev.pos())

        # Update coordinates in status bar if image is opened
        window = self.parent().window()
        if window.filePath is not None:
            self.parent().window().labelCoordinates.setText(
                'X: %d; Y: %d' % (pos.x(), pos.y()))

        # Polygon drawing.
        if self.drawing():
            self.overrideCursor(CURSOR_DRAW)
            if self.current:
                color = self.drawingLineColor
                if self.outOfPixmap(pos):
                    # Don't allow the user to draw outside the pixmap.
                    # Project the point to the pixmap's edges.
                    pos = self.intersectionPoint(self.current[-1], pos)
                elif len(self.current) > 1 and self.closeEnough(pos, self.current[0]):
                    # Attract line to starting point and colorise to alert the
                    # user:
                    pos = self.current[0]
                    color = self.current.line_color
                    self.overrideCursor(CURSOR_POINT)
                    self.current.highlightVertex(0, Shape.NEAR_VERTEX)

                if self.drawSquare:
                    initPos = self.current[0]
                    minX = initPos.x()
                    minY = initPos.y()
                    min_size = min(abs(pos.x() - minX), abs(pos.y() - minY))
                    directionX = -1 if pos.x() - minX < 0 else 1
                    directionY = -1 if pos.y() - minY < 0 else 1
                    self.line[1] = QPointF(minX + directionX * min_size, minY + directionY * min_size)
                else:
                    self.line[1] = pos

                self.line.line_color = color
                self.prevPoint = QPointF()
                self.current.highlightClear()
            else:
                self.prevPoint = pos
            self.repaint()
            return

        # Polygon copy moving.
        if Qt.RightButton & ev.buttons():
            if self.selectedShapeCopy and self.prevPoint:
                self.overrideCursor(CURSOR_MOVE)
                self.boundedMoveShape(self.selectedShapeCopy, pos)
                self.repaint()
            elif self.selectedShape:
                self.selectedShapeCopy = self.selectedShape.copy()
                self.repaint()
            return

        # Polygon/Vertex moving.
        if Qt.LeftButton & ev.buttons():
            if self.selectedVertex():
                self.boundedMoveVertex(pos)
                self.shapeMoved.emit()
                self.repaint()
            elif self.selectedShape and self.prevPoint:
                self.overrideCursor(CURSOR_MOVE)
                self.boundedMoveShape(self.selectedShape, pos)
                self.shapeMoved.emit()
                self.repaint()
            return

        # Just hovering over the canvas, 2 posibilities:
        # - Highlight shapes
        # - Highlight vertex
        # Update shape/vertex fill and tooltip value accordingly.
        self.setToolTip("Image")
        for shape in reversed([s for s in self.shapes if self.isVisible(s)]):
            # Look for a nearby vertex to highlight. If that fails,
            # check if we happen to be inside a shape.
            index = shape.nearestVertex(pos, self.epsilon)
            if index is not None:
                if self.selectedVertex():
                    self.hShape.highlightClear()
                self.hVertex, self.hShape = index, shape
                shape.highlightVertex(index, shape.MOVE_VERTEX)
                self.overrideCursor(CURSOR_POINT)
                self.setToolTip("Click & drag to move point")
                self.setStatusTip(self.toolTip())
                self.update()
                break
            elif shape.containsPoint(pos):
                if self.selectedVertex():
                    self.hShape.highlightClear()
                self.hVertex, self.hShape = None, shape
                self.setToolTip(
                    "Click & drag to move shape '%s'" % shape.label)
                self.setStatusTip(self.toolTip())
                self.overrideCursor(CURSOR_GRAB)
                self.update()
                break
        else:  # Nothing found, clear highlights, reset state.
            if self.hShape:
                self.hShape.highlightClear()
                self.update()
            self.hVertex, self.hShape = None, None
            self.overrideCursor(CURSOR_DEFAULT)
1149644
function (legend, item) {
		var radius = pInt(legend.itemStyle.fontSize) / 2;
		
		item.legendSymbol = this.chart.renderer.circle(
			radius,
			legend.baseline - radius,
			radius
		).attr({
			zIndex: 3
		}).add(item.legendGroup);
		item.legendSymbol.isMarker = true;	
		
	}