Questions tagged [drawrectangle]

DrawRectangle() is commonly the name of a method for drawing rectangles in several related Windows APIs.

See:

210 questions
16
votes
7 answers

opencv rectangle with dotted or dashed lines

I have a line of code here that uses the python binding for opencv: cv2.rectangle(img, (box[1], box[0]), (box[3], box[2]), (255,0,0), 4) This draws a red rectangle on image img of thickness 4. But is there a way the lines of the rectangles can be…
user961627
  • 12,379
  • 42
  • 136
  • 210
10
votes
2 answers

How to add text into a pygame rectangle

I have come as far as drawing a rectangle in pygame however I need to be able to get text like "Hello" into that rectangle. How can I do this? (If you can explain it as well that would be much appreciated. Thank-you) Here is my code: import…
PythonNovice
  • 475
  • 2
  • 5
  • 21
9
votes
3 answers

How to create a Rectangle object in Java using g.fillRect method

I need to create a rectangle object and then paint it to the applet using paint(). I tried Rectangle r = new Rectangle(arg,arg1,arg2,arg3); Then tried to paint it to the applet using g.draw(r); It didn't work. Is there a way to do this in java? I…
imulsion
  • 8,820
  • 20
  • 54
  • 84
7
votes
3 answers

Move a rectangle using angles

I need to move a rectangle using angles. Actually I want to change the direction of my moving rectangle when it reaches the location I have given in my code in if statement! I just need the way I can find out how to move my rectangle at 60, 30, 60,…
Java Nerd
  • 958
  • 3
  • 19
  • 51
7
votes
3 answers

Draw Rectangle in MonoGame

How do you draw shapes, such as Rectangles and Circles, in MonoGame without having to save the a predrawn shape in the Content folder? DrawRectangle() and DrawEllipse() are for Windows Form and do not work in OpenGL, which is what I am using.
Evorlor
  • 7,263
  • 17
  • 70
  • 141
5
votes
4 answers

Clearing DrawRectangle in Windows Forms

I am drawing a rectangle, sleeping for a few milliseconds--then I want to clear the rectangle, but I can't figure out how. (The rectangle is sitting over a graphic so I can't simply cover it up with another rectangle) …
Jeff
  • 8,020
  • 34
  • 99
  • 157
5
votes
0 answers

How to draw rotated rectangle with Python

I have the center coordinate, rotation angle, width and height. With this I want to draw a rotated box on the original image using the rotation angle. Is there any method in Python2.7 to achieve my requirement? It should looks like this image as red…
5
votes
3 answers

drawing a rectangle with mouse click and drag - javascript

I was trying to draw a rectangle (actually a selection box) in Javascript, to select the SVG elements that come in the selection. I tried to fix the code for the click and drag rectangle: http://jsfiddle.net/7uNfW/26/ but there is some problem that…
user1340852
  • 825
  • 3
  • 9
  • 27
4
votes
1 answer

Drawing rectangle using mouse events in Tkinter

This is with respect to Draw rectangle on mouse click [Python]. I tried out the first solution and it works perfectly. Can someone please tell me, what to do if I want to see the rectangle being drawn and the rectangle gets fixed once the mouse…
Anuradha
  • 1,089
  • 4
  • 18
  • 29
4
votes
1 answer

Html 5 canvas rectangle removing and after draw

I tried to draw a rectangle ,erase it and redraw another rectangle in a canvas. The result of this three operation is that there are two rectangle . Html 5 api javascript : http://pastebin.com/Qgf38C7m function…
lv92
  • 161
  • 3
  • 11
4
votes
1 answer

WPF mutliselection of shapes using drag rectangle

I would like to implement multiple selection of shapes using a drag rectangle. I've many shapes on a canvas like that : Thoses shapes are bound to corresponding models (MVVM). My selection rectangle looks like that : When I finished drawing the…
Ben
  • 3,972
  • 8
  • 43
  • 82
4
votes
3 answers

WriteableBitmapEx.DrawRectangle Thickness?

How do you change the thickness/weight for the rectangle outline drawn with the WriteableBitmapEx.DrawRectangle extension method? The code I use to draw the rectangle is: WriteableBitmap wbmp = new WriteableBitmap(bmp); wbmp.DrawRectangle(0, 0, 480,…
msbg
  • 4,852
  • 11
  • 44
  • 73
4
votes
1 answer

Drawing a image on a JPanel and adding it to JFrame

I'm a beginner high school java student and I have to make a simple box and whisker thing. I can't get the stuff I draw on the JPanel to show up on the JFrame. The drawing just doesn't show up. Could anyone help me? public class BoxPlot extends…
3
votes
1 answer

How do I draw a rounded rectangle without filling it (in MFC)?

Another drawing question for you MFC/GDI gurus out there... :-) I'm using MFC, and I'm doing some drawing with a CDC object. That works fine. But now I want to draw a rectangle with rounded corners, the line being a couple of pixels wide. But I dont…
UglySwede
  • 429
  • 1
  • 7
  • 16
3
votes
2 answers

Draw only corner of a rectangle

I used Pen pen = new Pen(Color.Red); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; to shape the border of rectangle but now I only need to show the corner of that rectangle.
Soheila Hg
  • 569
  • 2
  • 7
  • 25
1
2 3
13 14