A rectangle is a geometric shape: any quadrilateral with four right angles
Questions tagged [rectangles]
1373 questions
0
votes
2 answers
When I used Matrix and Rectangle assignment in XNA does it duplicate or reference?
I have a question about XNA which I am new too and could not find a clear answer for in the documentation after searching google.
Question 1:
If I do this:
Rectangle afterMoveRect = collisionRectangle;
afterMoveRect.Offset((int)moveAmount.X,…

AturSams
- 7,568
- 18
- 64
- 98
0
votes
1 answer
Split a Rectangle into n equal Parts
I need to split a rectangle Rect Structure, Rect(Double X, Double Y, Double Width, Double Height) into a number of smaller rectangles/structures for n = 2, n= 4 and n = 6, i define a Rect for my Diagram (Nodes and Links) that bounds the whole…

H79
- 335
- 1
- 5
- 14
0
votes
2 answers
Detect object stored in Mat image opencv
I'm trying to detect an object using opencv and Visual Studio Ultimate using C++. I'm having problems concerning cv::Mat, I cannot find any example of object detection with that kind of variable but just with IplImage. I tried to use an IplImage…

Daisy
- 1
- 1
0
votes
2 answers
Finding the largest 16:9 rectangle within another rectangle
I am working on this Lua script and I need to be able to find the largest 16:9 rectangle within another rectangle that doesn't have a specific aspect ratio. So can you tell me how I can do that? You don't have to write Lua - pseudocode works…

Funstein
- 23
- 3
0
votes
3 answers
Smallest set of rectangles describing a set of integer points
Given a set of N-dimensional integer points how do I find the smallest set of N-dimensional cuboids (rectangles in the 2-d case), such that an integer point is in the set of integer points if and only if it's contained in one or more of the…
Chris
0
votes
2 answers
iOS setNeedsDisplay in multiple regions
I have a custom view which has a piano keyboard drawn inside of it. Each key is drawn as a separate call, so that I can only draw keys that need redrawing. The view supports multiple touch, so multiple keys can be held down at once.
Each key is…

phosphoer
- 433
- 6
- 16
0
votes
1 answer
Point of Origin, Width, Height
Rectangle left = new Rectangle(0,0,WIDTH/9,HEIGHT);
In this code, if I increase the width why does it look like it extends farther over to the left on the JFrame? And if I decrease it why does it extend out to the right? Does this not work like a…

Martin Marino
- 375
- 2
- 5
- 14
0
votes
3 answers
How can I find UIElements in a rectangle in WPF?
I need to find UIElements in (rectangle/area/bounds).
MainWindow I'm doing the following:
I register the mouse down as the start position.
I regsiter the mouse up position.
Now I need to find ll (buttons, textboxes, etc) in the rectangle between…

Bassam Alugili
- 16,345
- 7
- 52
- 70
-1
votes
1 answer
Align end of lines of ellipse on top of rectangle border
I have the following code to draw circles, squares, ellipses and (wrong) rectangles with equal angle sections. Circles, squares and ellipses work fine, but what i want to achieve with the rectangle code is that the end of the sections lines don't…

somsam43
- 9
- 4
-1
votes
1 answer
Tkinter create_rectangle performance
I'm using create_rectangle to draw and update a WxH grid on a canvas in an infinite loop. I notice the refresh rate greatly slows down after a few minutes. After doing some reading I realized that create_rectangle creates an object, which I think is…

gvrana
- 1
- 2
-1
votes
1 answer
Draw boxes in canvas using x y coordinate from mysql table
I am trying to draw in a panel of 1000 * 1000 a series of rectangles of three different colors. The x and y coordinates of each rectangle are taken from a mysql table (info_x and info_y).
If situations arise when reading other columns of the mysql…

iz1kbp
- 11
- 3
-1
votes
1 answer
Android draw stripes of different height in a view
I'm using Java, Android studio. In a view, I need to programmatically create a random number of stripes of different colours and height as a % of the parent view height on the screen. No charts. Only a single column of stacked striped with varying…

Cerberus
- 9
- 3
-1
votes
1 answer
Rectangle packing algorithm with desired position?
I'd like to implement a variation of a rectangle packing algorithm in C#. In my case the rectangles have a width and height and a "desired" position in a 2D plane (on the screen). They must however not overlap. I want the algorithm to find the…

Yahriven
- 3
- 2
-1
votes
1 answer
Change color of the rectangle which the mouse is in by using the mouse wheel
Sorry for posting my whole code but this way you can check my problem easier, no?
package task3;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import…

Bunsekanse
- 25
- 6
-1
votes
2 answers
How do I find the intersection of a Rectangle?
import java.util.Scanner;
public class RectangleTester {
public static void main(String[] args) {
Rectangle rectangle1 = new Rectangle(0, 0, 0, 0);
Rectangle rectangle2 = new Rectangle(0, 0, 0, 0);
Scanner input = new…

Singh is Bling
- 7
- 4