draw

Draw a border around a part of NSAttributedString

回眸只為那壹抹淺笑 提交于 2019-12-23 01:52:28
问题 I'm developing a MacOs application and have to implement my own search functional due to custom interface. So the question is - how can a draw a border around a part of NSAttributedString in NSTextView to display search result (just how it's done in TextEdit app). Please check the desired look on the attached image: http://d.pr/i/w8wP [UPDATE] Due to custom interface requirements I can't use NSTextViews's setUsesFindBar: and setUsesFindPanel: . The interface has a custom NSSearchField, which

Drawing a circle with triangles WebGL

混江龙づ霸主 提交于 2019-12-22 13:58:10
问题 I'm new to WebGL and was trying to draw a circle with triangle_fan. I set up the variables var pi = 3.14159; var x = 2*pi/100; var y = 2*pi/100; var r = 0.05; points = [ vec2(0.4, 0.8) ]; //establish origin And then drew the circle using this for loop. for(var i = 0.4; i < 100; i++){ points.push(vec2(r*Math.cos(x*i), r*Math.sin(y*i))); points.push(vec2(r*Math.cos(x*(i+1)), r*Math.sin(y*(i+1)))); } The issue is that I am actually pushing in the second point again when i increases which I don't

programming a contest based on cupon codes in drupal

天涯浪子 提交于 2019-12-22 10:27:38
问题 Is there any module that can ask upon user registration so that the user can have a cupon code? I want to use them later to draw prizes. Just like a lottery 回答1: Have you give a try to Registration code? It sounds like it could do the job that you are asking for. 来源: https://stackoverflow.com/questions/5632683/programming-a-contest-based-on-cupon-codes-in-drupal

Leaflet Draw spritesheet icon issue - Missing and then not aligned

南笙酒味 提交于 2019-12-22 09:09:11
问题 I have incorporated leaflet draw in one of my projects. My issue is that the icons were not displaying in the tool bar. It looked like this: Looking around I found THIS post and did as it stated. I located the spritesheet in the Leaflet Draw folder and linked to it like htis: .leaflet-draw-toolbar a { background-image: url('E:/MappingProject/Leaflet.Draw/src/images/spritesheet.png'); background-repeat: no-repeat; } I ended up with this: I can't seem to find any other solutions to get this

draw a single-touch motion path in android

ε祈祈猫儿з 提交于 2019-12-22 05:11:57
问题 i am trying to make a drawing application. i want to draw a single-touch motion path in android - like the way the Swype keyboard does it. And consequently i want to store x-y coordinates of EACH of the pixels of the motion path into a data structure. How can i use the MotionEvent pointers to do this? 回答1: You probably don't have to store every pixel - just store a new one when certain parameters are met such as the pixel is further along or if the angle between one pixel and the next is

Draw into UIImage

不想你离开。 提交于 2019-12-21 14:58:11
问题 how can I draw into an existing UIImage using monotouch? I load an image: UIImage.FromFile("MyImage.png") Then I want to draw a string and some lines into this image. Does anyone has a code sample? Thx 回答1: Here is a method that does it: private void drawOnTouch(object data) { UITouch touch = data as UITouch; if (null != touch) { UIGraphics.BeginImageContext(this.Image == null ? this.Frame.Size : this.Image.Size); using (CGContext cont = UIGraphics.GetCurrentContext()) { if (this.Image !=

Matplotlib and Networkx - drawing a self loop node

别来无恙 提交于 2019-12-21 14:05:23
问题 I have this function and I want to draw a self loop. How can I do that? The edge exists but I think it's just a point in this exemple is (1,1) and I couldn't add the name of nodes. My goal is from adjacency matrix draw a graph. Is there there is better way to do this? import networkx as nx import matplotlib.pyplot as plt from matplotlib.patches import FancyArrowPatch, Circle import numpy as np def draw_network(G,pos,ax,sg=None): for n in G: c=Circle(pos[n],radius=0.05,alpha=0.7) ax.add_patch

Matplotlib and Networkx - drawing a self loop node

天大地大妈咪最大 提交于 2019-12-21 14:05:12
问题 I have this function and I want to draw a self loop. How can I do that? The edge exists but I think it's just a point in this exemple is (1,1) and I couldn't add the name of nodes. My goal is from adjacency matrix draw a graph. Is there there is better way to do this? import networkx as nx import matplotlib.pyplot as plt from matplotlib.patches import FancyArrowPatch, Circle import numpy as np def draw_network(G,pos,ax,sg=None): for n in G: c=Circle(pos[n],radius=0.05,alpha=0.7) ax.add_patch

Drawing different colored shapes in a path (HTML5 Canvas / Javascript)

这一生的挚爱 提交于 2019-12-21 07:07:09
问题 I'm trying to draw multiple circle arcs filled with different colors //-------------- draw ctx.beginPath(); ctx.fillStyle = "black"; ctx.arc(30, 30, 20, 0, Math.PI*2, true); ctx.fill(); ctx.fillStyle = "red"; ctx.arc(100, 100, 40, 0, Math.PI*2, true); ctx.fill(); ctx.closePath(); This produces both arcs filled in with red, and I can tell that there is a faint black outline around the smaller one. Can anyone shed some light on how I can accomplish this? what I'm doing wrong? 回答1: Close the

Redraw multiple Paths at same positions from previous layout orientation

好久不见. 提交于 2019-12-21 04:21:55
问题 Based on my previous question of "How to create a BottomBar as StickyBottomCaptureLayout in camera2 Android api?", I created a layout with a StickyBar (SB) which is always locked above/near the system bar. I set the default positions and coordinates of the SB and the other layout in onLayout() (exactly as my answer). The upper layout is a simple custom DrawView which has an ArrayList of Path s drew by the user. When the device rotates, it recalls onDraw() and calls several times canvas