rectangles

How create a screenshot of a particular area?

喜你入骨 提交于 2020-01-01 05:04:09
问题 I have code that receives a specific area already defined before on server side and creates a hole on Form in client side. Instead of this, i want to get a screen capture of this same area but without appears my Form in final result, like a normal desktop capture, but in this case will be only captured, this small area. So, how i can adapt this my code below for this? procedure TForm1.CS1Read(Sender: TObject; Socket: TCustomWinSocket); var X1, X2, Y1, Y2: Integer; List: TStrings; FormRegion,

How to find intersection rectangle(points) of instersecting rectangles

扶醉桌前 提交于 2019-12-31 05:38:06
问题 If I have two instersecting rectangles [(x1,y1)(x2,y2)][(x3,y3)(x4,y4)] described by two verticles. How to find a rectangle which is effect of their intasection( get 2 points where these rectangles intersect ). Prgramming language does not matter. May be pseudo code. PS: Rectangles are parallel to the OXY. 回答1: You could use Rectangle.intersection: Rectangle intersection = rectangle1.intersection(rectangle2); 2 of the vertices of the resulting rectangle will be the intersection points. You

How to draw a rectangle in WPF at a specific x,y screen location?

半城伤御伤魂 提交于 2019-12-30 08:20:53
问题 In C#, WPF I've created a rectangle: Rectangle myRgbRectangle = new Rectangle(); myRgbRectangle.Width = 1; myRgbRectangle.Height = 1; SolidColorBrush mySolidColorBrush = new SolidColorBrush(); Yes, I really just want it to be 1 pixel by 1 pixel. And I want to change the color based on the variable height like so: mySolidColorBrush.Color = Color.FromArgb(255, 0, 0, (byte)height); myRgbRectangle.Fill = mySolidColorBrush; Now, how do I draw at a specific x,y location on the screen? I do have a

Create transform to map from one rectangle to another?

回眸只為那壹抹淺笑 提交于 2019-12-30 04:33:30
问题 What is the simplest way to create AffineTransform which maps coordinates from one rectangle to another (float/double rectangles are given)? UPDATE 1 Rectangles can be absolutely different. For example [(0,0)-(1,1)] and [(150,-14)-(-1000,-14.1)]. And transformation should transform uniformly. For example, rectangle corners should be transformed one to one. For example coordinates (0,0) should turn to (150,-14). UPDATE 2 I need AffineTransform object, not just calculation. Because I want to

Merging multiple adjacent rectangles into one polygon

蓝咒 提交于 2019-12-28 10:12:07
问题 Background : I am working on a site for small shopping center, which has multiple rectangular "units" to rent. When a "shop" comes, it can rent one or multiple "units", and I'd like to generate a map consisting of shops (sans unrented units) Problem : I have a list of rectangles ( units ), defined by pairs of points – [[lefttop_x;lefttop_y];[rightbottom_x;rightbottom_y]] – and I want to merge them into polygons, so I can properly style them (which I will then render via Canvas/SVG/VML/Raphael

Merging multiple adjacent rectangles into one polygon

笑着哭i 提交于 2019-12-28 10:07:43
问题 Background : I am working on a site for small shopping center, which has multiple rectangular "units" to rent. When a "shop" comes, it can rent one or multiple "units", and I'd like to generate a map consisting of shops (sans unrented units) Problem : I have a list of rectangles ( units ), defined by pairs of points – [[lefttop_x;lefttop_y];[rightbottom_x;rightbottom_y]] – and I want to merge them into polygons, so I can properly style them (which I will then render via Canvas/SVG/VML/Raphael

deformed rectangulars with decreasing trend

╄→гoц情女王★ 提交于 2019-12-25 12:13:13
问题 i have to implement some figures like that on the Picture with python (matplotlib). Has anyone an idea how i could achieve this? I tried to work with polygons to create these deformed rectangulars, for example like this: import matplotlib.pyplot as plt plt.axes() points = [[x, y]] polygon = plt.Polygon(points) plt.show() but it just shows a coordinate system and nothing else when I type in the x,y points to get a deformed rectangular. Edit I now used the answer by @ImportanceOfBeingErnest,

deformed rectangulars with decreasing trend

 ̄綄美尐妖づ 提交于 2019-12-25 12:13:12
问题 i have to implement some figures like that on the Picture with python (matplotlib). Has anyone an idea how i could achieve this? I tried to work with polygons to create these deformed rectangulars, for example like this: import matplotlib.pyplot as plt plt.axes() points = [[x, y]] polygon = plt.Polygon(points) plt.show() but it just shows a coordinate system and nothing else when I type in the x,y points to get a deformed rectangular. Edit I now used the answer by @ImportanceOfBeingErnest,

Array Creation Stack overflow

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 04:12:21
问题 I'm getting an error where it would keep giving me a stack overflow. What I basically wanna do is create an Array List of objects that have rectangles. However, if any of the object overlap one another then, I would call the method again and create an array till it creates an array of objects that do not overlap. Can anyone tell me whats wrong? public class TokenArrayCreator { public final int TOKEN_WIDTH= 35; private GameToken token1; private ArrayList<GameToken> tokenarr; public

Adding content/text in rectangle WPF

筅森魡賤 提交于 2019-12-24 18:13:11
问题 This is my code for rectangle : <Rectangle x:Name="rect1" Grid.Column="1" Fill="#FF5C626C" HorizontalAlignment="Left" Height="50" Margin="36,171,0,0" StrokeThickness="2" VerticalAlignment="Top" Width="358" RadiusX="30" RadiusY="50"> <Rectangle.Triggers> </Rectangle.Triggers> <Rectangle.Style> <Style TargetType="Rectangle"> <Style.Triggers> <EventTrigger RoutedEvent="Rectangle.MouseEnter"> <BeginStoryboard> <Storyboard> <ParallelTimeline > <ColorAnimation Storyboard.TargetProperty="Fill.Color"