clipping

How do I clip a line segment against a frustum?

Given two vectors A and B which form the line segment L = A-B. Furthermore given a view frustum F which is defined by its left, right, bottom, top, near and far planes. How do I clip L against F? That is, test for an intersection and where on L that intersection occurs? (Keep in mind that a line segment can have more than one intersec...

WPF: When is a WrapPanel full.

I'm using a WrapPanel to display variable height items in columns. The wrappanel has a constrained size. Is there an way to determine when the WrapPanel is 'full'? I will then page to another panel with an animation. I've looked at the ArrangeOverride of the items that are the panels children, but they always seem to be getting all...

How to make the Canvas clip its contents in Flex?

I draw a line on a Canvas object with the moveTo and lineTo graphics methods. If one end of the line lies outside the Canvas, the line spills out and is drawn over or under other elements in the application. How do I make the Canvas keep the line contained within itself? Thanks! ...

.NET: Painting (clipping) only part of a control?

I have a VB.NET program where I'm using a WebBrowser control to simulate a timesheet form. For data entry, I'm using a DateTimePicker control that sits on top of the WebBrowser control, which I have programmed to move on top of the cell of the table in the WebBrowser control when the WebBrowser control is clicked on. (If you want to ask ...

My Quartz drawing on iPHone is clipped after rotation!

I'm drawing three rectangles, one of which falls off the end of the view, (i.e. the drawing is bigger than the current view bounds) so you don't see the right edge. This is good, but when the view is rotated, the right edge is still clipped, even though there's plenty of room to draw it. How can I get the view to redraw the full rectan...

Multiple view frustum clipping

The function gluPerspective() can be used to set near Z and far Z clipping planes. I want to draw a scene clipped at a certain far Z plane, and draw another scene beyond this Z plane. Is it possible to do this clipping twice per frame? ...

Most elegant way to clip a line?

I have a Rectangle2D and a Line2D. I want to "clip" the line so that only the part of the line which is within the rectangle remains. If none of the line is within the rectangle I want the line to be set to (0,0,0,0). Basically something along the lines of a Rectangle2D.intersect(Line2D src, Line2D dest) or something similar. Is ther...

Changing a view's visibility affect's parent's clipping

Hi, I've encountered a really, really weird behavior mix that I believe has to be a bug, and I'd like to either be enlightened, or work with you guys to find a workaround. The issue is as follows: UIView* bigView UIView* barView UIView* buttonView UIView* imagesView buttonView and imagesView are children of barView, which in turn i...

Determine path dynamically in Silverlight 2

I have a border with rounded corners within a canvas and want to add a clipping region to the canvas so that anything I add is clipped to the region within the border. I know that I can set the Clip property of the canvas but as the canvas and object are sized dynamically rather than having sizes assigned in the XAML, I can't figure out ...

Where Can I Find Current Adobe Image Format Specifications? "Clipping Paths"

This is in regards to Adobe's Image Resource Blocks(IRB), that they store in TIFF, PSD, JPEG Formats. It's also called "8BIM", This standard was released with Adobe's Photoshop 3 (November 1994). IRB contains information on color profiles and clipping paths(what i am interested in). The only piece of documentation i can find on the int...

Clip or Mask a 2D texture

Hey i was wondering if anyone knows to do clipping with 2D textures for a gui or menu like system. Heres an example output i would like to produce Have a game screen with a size of 500 x 500. With a screen behind it with a size of 1000 x 1000. When i draw a Texture at 0, 0 with the parent screen of 500 x 500 i would like the component...

How do i control clipping in c# or xaml when using UniformToFill with an image.

I have an image control in a resizable window with its stretch property set to UniformToFill. <Image Name="some_image" Stretch="UniformToFill" Margin="0,0,0,0" /> The clipping window is pegged to the top left of the image; resizing chops off the right and bottom of the image. I want the image to be clipped equally on all sides. Am i...

XAML tooltips are being clipped

I am trying to make a WPF app (regular Windows app, not XBAP or Silverlight). I want the main app window to support transparency, and show through the desktop below. But when I specify ToolTip text on a Button, the ToolTip appears beneath (z-order) the main window! I have a screenshot where: * Another app overlapps and blocks view of t...

iphone interface overlay pass-through events

Hi All, I'm farily new to iphone dev (<3 months on my free time) and I'm starting development of my second app. From the image, I'm adding a number of UIViews as subviews to my main UIViewController.view, the number of Views to add varies based on user selectable data. Each view contains several controls, a label, a UITextField and ...

Silverlight: Canvas overflows

Hi all! I have created a Canvas, and within it I placed a StackPanel. The StackPanel is horizontal, and it accepts a list of thumbnailed images. The Canvas has a fixed size. When I put more thumbnails than the Canvas width can hold, the StackPanel is supposed to overflow from the Canvas, so I can move it to center the current thumbnail....

Blackberry setting a clipping region/area

In J2ME we have the clipRect() and setClip() to clip a region in the Graphics area. What is the equivalent apis available in BlackBerry and how do we use it? ...

Silverlight - polygon scaling and clipping

I have a Canvas, to which I've added several thousand polygons. I would like to be able to zoom in (which I'm doing via a ScaleTransform. However I've been trying to use a Canvas.Clip as well to only draw a portion of the Canvas, but as soon as the ScaleTransform values are changed, the clipping stops working... <Canvas Grid.Row="...

Strange Clipping Issue in OpenGL

Hey all, I am very very new to OpenGL, so please bear with me. :) I'm working through NeHe's OpenGL tutorials, and I have developed my own version of Lesson 5, in which you rotate a 3D shape around the origin. I'm not sure what I did wrong, I copied the code nearly line-for-line, but I'm seeing strange overlaps in my surfaces. Does anyo...

Drag a zoomed image within a div clipping mask using jQuery draggable?

I'm creating an interface to allow a user to zoom in on an image and drag the zoomed version around within a clipping mask div. I have a div 200px by 200px that I set overflow: hidden on. Then I load a std img (<img src="etc">) into the div that is, say, 1000px by 1000px. Then I use jQuery $("#my-image").draggable({ containment: [-8...

Clipping WPF elements in a canvas

I am working on an interactive WPF graph/tree tool and have nodes and links between them placed in a canvas. The nodes are usercontrols and the links are simply Line shapes, and currently the links go from the centre of a node to another node's centre. The problem arise when I want the nodes to be slightly transparent and one sees the l...