Questions tagged [rectangles]

A rectangle is a geometric shape: any quadrilateral with four right angles

1373 questions
-2
votes
1 answer

How to draw rectangle frame in android

I want to draw a square shape every time I can use it. The barcode shown is only representative. I want to make a drawing that I can give the dimensions of the square like the picture. how can I do that ? what can i research? I would like to do this…
user9304297
  • 23
  • 1
  • 7
-2
votes
1 answer

java change size of square by pressing a button

Hi I am trying to change the size of my square by putting a button, let's name it plus, that it adds a units for example, if my square is 1cm*1cm the plus button makes it 10cm*10cm I did diminuer() to test if it works but it doesn't it says that…
-2
votes
1 answer

Printing rectangle in java (there is hole in center)

I want create a rectangle which has hole in the middle. How can I import wallThick :) I define width, height, wallThick but I just write a rectangle. I can't press any hole. Could you help me please... Thanks for all... if (width <= 0 || height…
-2
votes
1 answer

Matlab: Position of X, Y, width and length to pixel images

I was given some data that I would like to convert to a pixelized image. From what I understood, the original data was plotted by using the function 'rectangle' in Matlab. However, a 2D image is now required. This data has four columns and ~1000…
Vinci
  • 3
  • 2
-2
votes
1 answer

How do you check if multiple rectangles overlap?

Square[] testSquares = new Square[3]; public SquareTester (){ for(int i = 0; i < testSquares.length; i++){ testSquares[i] = new Square(); } } public void paint(Graphics g) { for (int i = 0; i
-2
votes
1 answer

Rect position relative to point

i've quite noob geometry question. I have first rect, for example R1(0,0,320, 240), a point P1(20,40), and second rect R2(0,0,640,480), with point P2(40,80) i would like to calculate the position of 2nd rect, that makes two points share one…
-2
votes
1 answer

Checking Rectangle OverLap

Hello :) I'm currently working on something that hinges on checking the overlap of two rectangles in Java on BlueJ, and I've been checking the internet stuck for hours for anything to help but I've not managed to find anything which helps which is…
-2
votes
1 answer

java find intersection of Line and Rectangle

So, i am programming a small game. As the player, you fly a spaceship in 2d space. I want to have a marker that points at a selected Object like a sun or a planet, if selected in the scanner. Everything of that works fine except the drawing of the…
Spytrycer
  • 11
  • 7
-2
votes
1 answer

ios draw rectangle with top right corner

I am trying to make a rect which is drawn using it's top right corner (x,y) instead of the usual top left. I tried scaling by -1, but that didn't do the work. I need it because I am developing an app for RTL locale.
Daniel Rahamim
  • 285
  • 2
  • 18
-2
votes
1 answer

JavaFX rectangle width animation

just a question... is it possible to show the change of the width of a rectangle as an animation? The rectangle itself is a statusbar so a scale in both x directions does not do the job. thx
-2
votes
1 answer

Rectangle Hit Detection Java

Consider having an ArrayList rectangles = new ArrayList(); and a Player Class that has a rectangle variable, Character c = new Character(new Rectangle(x,y,w,h));. The Character class has an update() like so : public void…
TheBoxOkay
  • 81
  • 1
  • 8
-2
votes
1 answer

how to destroy graphics content?

How do I make shapes to burst or disappear when it intersects with a rectangle2D(bullet). Bursting will be preferable since I am developing a shooting game. I want the rectangle to burst or disappear when the bullet (another rectangle) intersects or…
-2
votes
1 answer

Drawing rectangle in c++ using functions

I have a problem with create drawing rectangles functions in C++. I have prepared c++ file, when I must finished drawing functions. I need to add functionality where on mouse click it will creating rectangle, and when I finished moving mouse and…
Pigius
  • 31
  • 1
  • 7
-2
votes
1 answer

How do you create 2 Rectangle objects that will collide and be detected in Java?

Also, is it possible to collide 2 Oval objects? public void paint(Graphics g){ g.setColor(Color.green);
g.fillRect(k, l, 100, 100);
g.setColor(Color.blue);
g.fillRect(n, m,…
-2
votes
1 answer

Adding text to a dynamic and clickable rectangle

I have a application which generate rectangles dynamically and which are clickable with the help of MouseLeftbuttonDown event. I want to add some text(different) to each of the rectangles. I have tried encapsulating rectangle and a textblock in a…
Ram Murti
  • 13
  • 7