FAQ Database Discussion Community


How to get all the coordinate points (X and Y) in ios

ios,xcode,draw,uibezierpath
I am writing an app which allows the user to draw what ever they want in the view. While they drawing I am sending the coordinate values simultaneously to web using Json and draw the same diagram in web. When I draw slowly I am getting all the coordinates values...

How to draw a specific shape in CSS? [closed]

css,draw,shape,css-shapes
I have shape as the image here. I don't how to draw it in CSS. Can any body help me to draw it? thanks...

pygame drawing a filled rectangle overwrite border, but only sometimes?

python,pygame,draw,rect,class-variables
I have a class in my pygame program that extends sprite, and effectively gives collision and whatnot to a rectangle. The __init__ of the class is as follows: def __init__(self,topleft,size,label): pygame.sprite.Sprite.__init__(self) self.image = pygame.Surface(size) self.rect = self.image.get_rect() self.rect.topleft = topleft self.image.fill([128,128,128]) pygame.draw.rect(self.image, [200,200,200], self.rect, 5) And this works great... for...

c draw function not drawing properly

c,draw
I'm trying to write a program that writes a digital car speedo onto an LCD screen (ST7735) with a Tiva C (Tm4C123GXL). The attached code is the draw line function that should draw a straight line between the two distances. if I put in (speed_x1, speed_y1, 80, 60, ST7735_WHITE) into...

Leaflet-draw : Create editable layers

angularjs,draw,leaflet,geojson,angular-leaflet-directive
My objective is to have a map to which I can add markers/polygons/... These elements will be saved into an Object for saving. The drawn elements can later be edited/deleted or added to. I have successfully managed to create/edit/delete them, but when I init my map with the saved objects...

Canvas draw text verticaly

java,android,text,android-canvas,draw
So, I have put everything I need how i need to be, my bitmaps, backgorunds and everything, what I need is to draw text that will be vertically shown. Here is my code for now: private void drawTables(Canvas canvas) { for (Table table : mTablesList) { float x = mWidht...

sqrt-based filled ellipse pixel drawing function

vb.net,lua,draw,pixels,ellipse
I'm trying to make a function in Lua or VB based code to draw / plot a filled ellipse. I don't have much knowledge about this math and I can use some help. I Googled everything there is to Google about drawing ellipses with code but I can't find a...

Delphi: Can't Draw On Panel's Canvas

image,delphi,canvas,draw
I'm trying to draw an image on a TPanel's Canvas in a procedure of this Panel. When I do this in Paint Method of the Panel it works just fine, but when I try to draw on the Canvas in another procedure or in the constructor nothing happens. This is...

Android Canvas drawLine not drawing on MainActivity

java,android,android-activity,canvas,draw
I want to draw a line on the Main Activity using Canvas. The problem is, it is not drawing anything. I have the following code: Bitmap bitmap = Bitmap.createBitmap(1920, 1080, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(); paint.setColor(Color.BLACK); paint.setStyle(Paint.Style.FILL_AND_STROKE); paint.setStrokeWidth(10); float left = 20; float top...

Rebin data and update imshow plot

python,numpy,matplotlib,draw,imshow
I have a large data set I want to be able to "zoom" in on. What I really want is for the data to be rebinned based on the selection and then update the data in the graph. So the graph will show different limits but maintain the same resolution....

Clearing Graphics from a Window in Python

python,text,graphics,window,draw
So I'm trying to make a timed loop where different text commands appear on the screen and users have to press the key that corresponds with the text command. The problem is since the text is centered it just draws over itself until the commands are unreadable. Is there a...

drawing gradient over rectangle in swift

ios,swift,draw,gradient
I try to draw a gradient in a rectangle. Following picture shows, that gradient in general works (blue), but it fills the entire screen. I like to do the gradient only in a specific area like the green rectangle. How can I do this ? My code for the gradient...

Drawing with timer is not working

java,swing,timer,awt,draw
I have problem with drawing in Java. I think my code is right, but when i place it to loop with timer, it will not print anything. I want to do every second repeat the doDrawing(g) method. Now it will only prints the text prom system.out but no drawing. package...

Customize a ProgressBar to become a Thermometer

android,drawing,draw,android-custom-view,android-progressbar
How to customize a ProgressBar to look like a Thermometer ? with the possibility to change color. My suggestion was to rotate the progressBar 90° to become vertical then have it overlay an image of an empty Thermometer but it's bad and messy solution. I Think the best will be...

libGDX draw a text using a decals to 3d facing camera

java,text,3d,libgdx,draw
I have a working code for drawing decals: Init: Decal decal = Decal.newDecal(1, 1, new TextureRegion(new Texture(Gdx.files.internal("2d/gui/badlogic.jpg"))) ); decal.setPosition(10, 10, 10); decal.setScale(3); decals.add(decal); Draw method: for (int i = 0; i < decals.size; i++) { Decal decal = decals.get(i); decal.lookAt(stage3d.getCamera().position, stage3d.getCamera().up); batch.add(decal); } batch.flush(); I have a working code for...

Draw a fill rectangle dynamically on screen in C#

c#,screen,draw
I would like to draw a fill rectangle dynamically on my screen, with an opacity at 0.1. The problem is that when i move the mouse, the previous rectangles aren't clear. This is the drawing methods. private void OnMouseDown(object sender, MouseEventArgs e) { isMouseDown = true; x = e.X; y...

How to draw a rectangle around multiline text

java,pdf,itext,draw
I am trying to draw a rectangle around multiline text in iText. The user will be able to enter some lines of text. The font size of the text might be different and it can be formatted (bold, underlined...). I use this code to draw the text: ColumnText ct =...

Draw text on screen

ios,text,draw
I keep it short: I am looking for a way to simply draw text (something like that: drawTextOnScreen:(NSString)stringToDraw at:(CGPoint)point on the screen just like drawing a line with for example: UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointMake(center.x, center.y+innerRadius)]; //lower [path addLineToPoint:CGPointMake(center.x, center.y+outerRadius)]; I really cant find an easy solution for...

My repaint in JFrame is not working

java,swing,draw,keylistener,repaint
I have a problem with repaint in JFrame i used repaint() earlier when i was making an animation and everything worked import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Draw extends JComponent implements KeyListener { int x = 0; int y = 0; public void paint(Graphics g){ g.setColor(Color.BLUE); g.fillRect(x, y,...

Processing: Trying to animate the drawing of lines without draw function

java,animation,twitter,processing,draw
I'm trying to write a program that is under 140 characters(Twitter Char Limit). The program displays the final output I want but I don't understand why it's not showing the animation as it creates it. I thought it was because I don't have a draw function but I don't see...

Drawing on a panel but when adding it through another frame, nothing draws

java,user-interface,panel,draw
I'm working on a project and the general idea of my work is to do every part of it in a stand alone project, then add it when finished to the main project through libraries. My problem is - one part I have done was to perform a painting on...

Libgdx blending contrast issue in render();

libgdx,rendering,draw,alphablending
In a Libgdx 1.x Stage, my goal is to apply a dark semi transparent mask on my screen except an area that should display the original screen. My global render method: public void render() { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setShader(null); update(); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); batch.begin(); darkener.draw(batch, 0.7f); spotlight.draw(batch, 1f); batch.end();...

C# Draw multiple Lines

c#,line,draw
Hi i'm drawing multiple lines with this code but i feel there is a better way doing this like a multidimensional array? or a list? private void drawLines() { int[] x1 = { 0, 0, 112, 222, 0, 333, 0, 1}; int[] x2 = { 334, 334, 112, 222, 334,...

How to correctly position a “X” in a rectangle?

c#,position,draw,square
I have the next problem: I have rectangle with 10 lines and 10 columns. When I press on a square I have to draw the "X" letter. Well, when I press on the right half, or on bottom half of the square, the "X" is drawn in the next right...

android draw rectangle with dimensions and modify them in runtime

android,runtime,draw,dimensions
I'm developing an engineering app for android. The thing is that I need to draw: rectangles, figures made of rectangles, and their dimensions. Then if you touch one extreme of one dimension you are able to make that dimension of the rectangle longer or shorter. I am implementing the next...

As3: Draw overlapping rectangles to a sprite and apply alpha

actionscript-3,graphics,sprite,draw
I need to draw independet rectangles to a sprite. But the overlapping areas will get visible if I apply alpha to my sprite (the sprite will be fade in and out): var spBox:Sprite = new Sprite(); this.addChild(spBox); spBox.graphics.beginFill(0x123456) spBox.graphics.drawRect(100, 100, 50, 50); spBox.graphics.endFill(); spBox.graphics.beginFill(0x123456) spBox.graphics.drawRect(125, 125, 50, 50); spBox.graphics.endFill(); Is...

How to draw in the screen AndroidStudio? [closed]

android,screen,draw
I am a beginner in develop apps, can someone send a simple code, or explain how can I draw something in the screen?

Draw an ellipse sqrt-based function

vb.net,plot,lua,draw,ellipse
I'm trying to make a function in Lua or VB based code to draw / plot an ellipse and also a filled ellipse. I don't have much knowledge about this math and I can use some help. I googled everything there is to google about drawing ellipses with code but...

Draw triangle by the intersect of 3 circles

javascript,canvas,draw
I want to draw a triangle base on the intersection points of 3 circles. Is there any function or any method with JavaScript to solve this? Or I need to perform some math calculation to get exact position of the intersection point and draw the triangle myself. function drawMap(){ var...

How to activate the method to draw from a button?

android,onclick,draw,activation
I am fairly new to android. I have this code to draw in my app, but I want activate it with a button. If I click on action bar button I'll should draw, otherwise I will should't do it. How can I do it? //DRAW public class CustomView extends View...

Drawing a simple image in R

r,image,plot,draw
I'm completely new to R (from MATLAB). I'm trying to generate a rectangular image composed of several smaller coloured regions. It is basically a thermometer. It will sit in a transparent/white background, with room to the left for a line/arrow pointing to a certain colour, with a character string left...

Draw color to every pixel in picturebox

c#,draw,picturebox,progress
Can someone help me: I want to draw colors every pixel to picturebox This is what I have done so far: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication25 { public partial class Form1 : Form { public Form1() {...

c# Draw Textbox onclick

c#,textbox,draw
For a project at school I need to create a program called Use Case Helper. When I click somewhere in the windows form application, a textbox must appear. I don't know how I can achieve this, I think with a paint event, but i couldn't find anything. Could someone point...

How to draw a animated line appearing in canvas html5?

javascript,jquery,animation,html5-canvas,draw
I´m wondering what is the right way to draw a line animation to display slowly like this effect in the opening seconds. http://dreamteam.pl/ Thanks!!...

Add white rectangle above a screenshot in a Graphics object (java) [duplicate]

java,graphics,draw
This question already has an answer here: How to add text to an image in java? 1 answer I've got a method that's supposed to add some text to screenshots. The screenshot is fed into this method as a File object like this: private void modifyScreenshot(File file) throws Exception...

Javascript drawing board with columns of alternating colors using ctx

javascript,draw
I would like to write a javascript code such that the boards appears as it is in this image: 1 This is my code so far: function draw() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var x, y; for (y=0; y<100; y+=10) { for (x=0; x<100; x+=5) {...

Draw a line every N words using iTextSharp

position,itextsharp,line,word,draw
Using iTextSharp, I create a pdf writing some text into it. What I need is to draw a line to delimiter the text every 25 words, like the following image: Basically, I need to do that: draw a line every 25 words, just like the image. I'm aware there's a...

Create Custom UIVview, circle with two color

ios,objective-c,uiview,draw
Theres any way that i can create a circle with two colors, like this : https://msresource.files.wordpress.com/2011/11/image4.png only detail, is the circle divides in a diagonal...

How to set timer in View class?

android,multithreading,timer,draw
I am trying to set a text which acts as a timer. I'll create timer easily if i extend Activity class. But i am facing lot of problem in this View class. Here i made a code where radius of circle will be reducing and it will be increased for...