rect

How can I find the Rect of wrapped text on an iPhone?

Can anybody recommend a good method for determining the Rect of some wrapped text on an iPhone? I've tried all the built-in methods for NSString in the 2.1 SDK to no avail. The size methods never return sizes that allow me to completely fit wrapped text in my custom view. I'm drawing some user customizable text that should always be a...

WPF Shape Rectangle Binding

Hi Guys. I'm trying to make some kind of shape in wpf, which does resize itself to the content (which should be text). Unfortunately, the stretch property isn't the right thing, since I want only the width of the Shape resized and without the borders (pls copy bottom example in xamlpad to see for yourself) of this shape stretched. The bo...

performance of frequently calling CGRectMake?

I would like to use CGRectMake to feed a rect structure to an image (image drawInRect:rect). Problem is, the position and the size of this rect will dynamically changed. Is there a performance hit for calling CGRectMake every "game loop frame"? Thanks! ...

Getting the visible rect of a zoomed UIImage on the screen

I have a UIImageView inside a UIScrollView. The UIImageView contains a UIViewContentModeScaleAspectFit content mode. I've also set the content size of the UIScrollview to the frame size (width, height) of my UIImageView and implemented a UIScrollview delegate method (viewForZoomingInScrollView:) to enable the zooming feature of my app. ...

Find Upper Right Point of Rotated Rectangle in AS3 (Flex)

I have a rectangle of any arbitrary width and height. I know X,Y, width, and height. How do I solve the upper right hand coordinates when the rectangle is rotated N degrees? I realized if it were axis aligned I would simply solve for (x,y+width). Unforunatly this doesn't hold true when I apply a transform matrix on the rectangle to rotat...

iPhone: detect any point in a rect in another rect

Is there any way to detect if any point in a given rect is contained inside of another, larger, rect? I'm trying to figure out when certain rects are on the screen (for memory management to deallocate the ones that aren't) but the rects are large and so sometimes only parts of them will be on the screen but I still need to have them load...

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 LayoutInformation.GetLayoutSlot but this just seems to return a Rect at 0,0 and doesn't reflect the actu...

converting canvas into bitmap in android

I am trying to develope an app on canvas ,i am drawing a bitmap on canvas with the help of canvas.drawBitmap().After that i want to convert that canvas into bitmap. can anyone give me suggession thanking you in advance ...