rectangle

Displaying rectangles in game window with XNA

I want to divide my game grid into an array of rectangles. Each rectangle is 40x40 and there are 14 rectangles in every column, with a total of 25 columns. This covers a game area of 560x1000. This is the code I have set up to make the first column of rectangles on the game grid: Rectangle[] gameTiles = new Rectangle[15]; for (int i =...

Count max rectangles number, that can be placed inside character

Hi, I need a solution for quite complex problem. Exactly, I need to calculate the number of rectangles that can be placed inside letter/character with given size, considering that all rectangles are the same size, but it(the size) and the letter/character(of some regular specific font) itself can be changed by user(this will be used as w...

Regarding Android Application Development

Hi What I need to do for making a customized rectangular bar having a logout/login button at the top of android screen ? for eg : top navigation bar in iPhone. Thanks ...

GDI+: Can't center String in Layout Rectangle

This is what I'm trying, and vertical centering is failing: void CGDIOverlays::drawText(RGB_COLOR color, const string &text, INT x, INT y, INT w, INT h, HFONT hFont, BOOL keepSize, BOOL staticText, UINT options ){ HDC hdc = m_pGraphics->GetHDC(); Gdiplus::Font graphFont( hdc, hFont ); m_pGraphics->ReleaseHDC( hdc ); if( stat...

How to make a rectangle on screen invisible to screen capture ?

How can I create a rectangle on the screen that is invisible to any sort of screen capture(printscreen or aplications) ? By create a rectangle on screen I mean something like this: #include <Windows.h> #include <iostream> void drawRect(){ HDC screenDC = ::GetDC(0); ::Rectangle(screenDC, 200, 200, 300, 300); ::ReleaseDC(0, screenDC); }...

Xcode - Drawing Pixels

Hi guys; I am trying to draw individual pixels in xcode to be outputted to the iphone. I do not know any OpenGL or Quartz coding but I do know a bit about Core Graphics. I was thinking about drawing small rectangles with width and height of one, but do not know how to implement this into code and how to get this to show in the view. Any...

c# winforms - scrollable panel with rectangles

Hi, I'm new to winforms and have tried to track down an answer to the following with no luck ... I have a panel in winforms and add to it a Rectangle that is wider than the panel itself. I've set the panel AutoScroll property to true however the panels horizontal scrollbar never appears. Why is this? And how do I get the scrollbar to sc...

Updating UIView subclass contents

Hi; I am trying to update a UIView subclass to draw individual pixels (rectangles) after calculating if they are in the mandelbrot set. I am using the following code but am getting a blank screen: //drawingView.h ... -(void)drawRect:(CGRect)rect{ CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillCol...

How to draw a translucent rectangle on a static text?

Hello, I draw a tranlucent rectangle on my panel but on the places that have static text's the rectangle is not filled. I've drawn rectangles inside each static text but when I do that, the correspondent text doesn't happear. How can I draw a translucent rectangle inside the statix text without making the text disappear? The code is ...

Minimum bounding rectangle of a circle on a sphere

What R packages are available to calculate the minimum bounding box for a great circle? For example: box <- polycirc( c( longitude, latitude ), distance=35 ) This would return the bounding box for the circle with a radius of 35 kilometres from the central point at the given coordinates (on Earth). Where: box.longitude_min = The l...

How to find the four coordinates and erase drawing of an rubberband rectangle in C#

Hi I have tried to draw an rubberband rectangle on a form using the mouse in C#. Problems 1) After the mouse release the rectangle disappears. [I want it to stay on the form] 2) I also need to find the coordinates of the four points of the drawn rectangle 3) I also need to erase the rectangle to draw a new one when necessary Form :...

Fixed gradient with a moving rectangle?

I have a WPF 'monitor widget' that displays CPU, RAM and disk performance as small percentage bars. I use the following gradient as a resource to divide the bars into 4 sections (ie. 0% - 25%, 25% - 50%, etc.) <LinearGradientBrush x:Key="Quarters" StartPoint="0,0" EndPoint="0,15" MappingMode="Absolute"> <GradientStop Color="LightGre...

How to get size of a rotated rectangle

Possible Duplicate: Calculate Bounding box coordinates from a rotated rectangle, Picture inside. I have a rotated rectangle, So how do i calculate the size of axis-aligned bounding box for the rotated rectangle in 2D Coordinates? Attach Image http://img88.imageshack.us/img88/503/rotp.png i know x, y, o (angle) but how do i ...

how to simulate a rectangle union starting with a rectangle intersection

Given rectangle_A intersecting rectangle_B, Which has a union defined such that it is the rectangle containing both rectangles: I want to determine the coordinates of the (not overlapping) rectangles required to add to rectangle_A to create the union of rectangle_A and rectangle_B: (note: this is just one configuration of the so...

How to shift item location on screen after iPhone rotation.

I have a UILabel that I need to shift up by about 50 pixels on application start (because it starts out in portrait, and I designed it in landscape) and then once again whenever it is put back in portrait. Right now I'm using a CGRect based on its current frame. The problem is when I try to rotate the phone the frame uses the portrait va...

How to track an area enclosed by a rectangle on a video in C# ?

Hi, this is what I am doing, I take the input from a web camera onto a picturebox in C# and draw a rectangle on the video using a mouse. Then I plan to track that particular area(e.g. right eye)enclosed by the rectangle, as the video streams, for instance if the person moves to the right, the rectangle will also move to the right but wil...

Binding RectangleGeometry.Rect doesn't show the rectangle

I'm having an issue trying to bind to a RectangleGeometry's Rect property. The basic idea here is that I'm attempting to bind a clip mask to control the visualized height of a pseudo-chart object. Here's the XAML: <Path x:Name="_value" Fill="{DynamicResource PositiveColorBrush}" Data="F1 M10,55 C10,57.75 7.75,60 5,60 2.25,60 0,57.75...

How can i draw a rectangle in android and put some text inside it and then place it?

hi i have an activity and in the activity i have some buttons and textviews, and i would like to draw a rectangle with text inside. i saw some examples online but the all say to create my on view , override onDraw and the set this view as my layout, but i have my layout already. public void onCreate(Bundle savedInstanceState) { su...

Moving some points in z-axis in OpenGL doesnt work

I have a simple rectangle i have drawn on screen in opengl. My target is to draw this rectangle in 3D so the left side of it is deeper (z-axis) than the right side. Look at this pic so you can see what i mean: http://www.battleteam.net/tech/fis/docs/images/metroid_hud1.png This is the code i use to draw a rectangle which uses differen...

How to find out whether an affine transformed rectangle contains a certain point, in Java?

Hi, I'm trying to make an interactive GUI but I need to move a certain object whenever that rectangle is clicked + dragged. Basically I wanna know whether a rectangle, that has been affine transformed, contains a specific point (x, y). Is there a way to do this? I have tried using contains() method but it doesn't work for a rectangle th...