Questions tagged [rect]

To be used with RECT structure when using winapi. For questions relating to rectangles not using this api, use the [rectangles] tag. Use with other relevant tags, such as programming language.

To be used with RECT structure when using winapi. For questions relating to rectangles not using this api, use the tag. Use with other relevant tags, such as programming language.

From the docs:

RECT structure
The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

639 questions
275
votes
14 answers

Can you control how an SVG's stroke-width is drawn?

Currently building a browser-based SVG application. Within this app, various shapes can be styled and positioned by the user, including rectangles. When I apply a stroke-width to an SVG rect element of say 1px, the stroke is applied to the rect’s…
Steve
  • 3,483
  • 5
  • 21
  • 20
232
votes
5 answers

SVG: text inside rect

I want to display some text inside SVG rect. Is it possible? I tried
Jakub M.
  • 32,471
  • 48
  • 110
  • 179
57
votes
2 answers

Rect and RectF in Android SDK

What is the difference between Rect and RectF in the Android SDK?
Iulius Curt
  • 4,984
  • 4
  • 31
  • 55
36
votes
14 answers

How to check intersection between 2 rotated rectangles?

Can someone explain how to check if one rotated rectangle intersect other rectangle?
Buron
  • 1,193
  • 2
  • 13
  • 23
19
votes
4 answers

Determine the bounding rect of a WPF element relative to some parent

I consider this a pretty simple request, but I can't seem to find a conclusive answer in my searches. How can I determine the bounds of a particular visual element in my window, relative to some other parent element? I've tried using…
devios1
  • 36,899
  • 45
  • 162
  • 260
18
votes
4 answers

Detect if one rect can be put into another rect

This problem is different from testing if one rect is in another rect. Known information is the sides length of two rects. How to calculate if one rect can be put into another rect?
cuixiping
  • 24,167
  • 8
  • 82
  • 93
17
votes
3 answers

How to procedurally draw rectangle / lines in swift using CGContext

I've been trawling the internet for days trying to find the simplest code examples on how to draw a rectangle or lines procedurally in Swift. I have seen how to do it by overriding the DrawRect command. I believe you can create a CGContext and then…
iphaaw
  • 6,764
  • 11
  • 58
  • 83
15
votes
2 answers

SVG rect border width

Is it possible to manipulate SVG rect's borders in the same way as it border-left-width, border-right-width and so on does?
Vasiliy Ermolovich
  • 24,459
  • 5
  • 79
  • 77
13
votes
2 answers

Android draw text into rectangle on center and crop it if needed

I want to draw text into rectangle on center (horizontally and vertically). If there is too much of a text that crop it what do not fit into rect. I have try to do it as this example show, but without luck. Any ideas?
zmeda
  • 2,909
  • 9
  • 36
  • 56
12
votes
7 answers

How can I randomly place several non-colliding rects?

I'm working on some 2D games with Pygame. I need to place several objects at the same time randomly without them intersecting. I have tried a few obvious methods but they didn't work. Obvious methods follow (in pseudo): create list of objects for…
John
  • 15,418
  • 12
  • 44
  • 65
10
votes
4 answers

Convert OpenCV's Rect to dlib's rectangle?

I use OpenCV's face detector with C++ for dlib's face alignment instead of dlib's detector because of slow speed. To use dlib's face alignment, I have to pass the detection rectangle to the face alignment function. However, I cannot do that even…
univ_student
  • 101
  • 1
  • 1
  • 3
10
votes
3 answers

Proper transform for scaling a UIView from a rect?

I want to mimic "zooming in" on a view. The larger view will be added as a subview to the smaller view's superview, and the larger view should look as if it is zooming in from the smaller view. Given the rect of the smaller view fromRect and the…
akaru
  • 6,299
  • 9
  • 63
  • 102
10
votes
3 answers

android how to rotate canvas rect

i create a rectangle in a specific size, and now i want rotate it to 45 degree, i used canvas.rotate, matrix, but not working. how is the proper way to rotate canvas in android? and i'm curios about Path.Direction.CW, is it used for rotation? but i…
Mat Yus
  • 289
  • 1
  • 2
  • 14
9
votes
2 answers

Position of rect Transform in unity UI

I found a very confusing issue in programming with Unity's UI rectTransform: in the inspector, we can find that the RectTransform's position was set to (0,0,0) but in the code in Start(), when I print the position: parentObject =…
armnotstrong
  • 8,605
  • 16
  • 65
  • 130
9
votes
3 answers

How to scroll to center of child of HorizontalScrollView?

I need to scroll to the center of childView(TextView) of the HorizontalScrollView. i have get the center child by using below code,now i want to adjust arrow to the exact center of that child view. here, what i've done is i took a…
NaserShaikh
  • 1,576
  • 2
  • 23
  • 39
1
2 3
42 43