Making the shadow from a ScatterViewItem a different shape - shadow

I am developing a program for Surface using Expression Blend and Visual Studio.
I have a custom user control with an ellipse and a label in a grid.
This will need to be placed in a scatterViewItem.
My problem is that the scatterviewitem will cast a rectangle shaped shadow under the ellipse shaped content. I can disable the shadow completely, but is there any way to make the shadow inherit the shape from its parent? Or can i set the shape of the scatterviewItem itself in any way?

Sorry but shaping the shadow directly is not possible... You have to create your own ChromeShadow. Take a look at the "ScatterPuzzle" Example from the Surface SDK.

Related

How to create a ring shape in Box2d

Circles are solid and there's no way to create an empty space inside them, is there?
It is possible to create it using a combination of the basic shapes (Chains/Edges) but I was wondering if there was an easier way?
The easiest way to make a ring would be draw a larger circle of the primary color, then draw a smaller circle inside of the background color (if it's a solid color.) Otherwise, use a texture with a transparent center.
No, there is no way to create a space inside a circle in box2d. ChainShape and EdgeShape will work, but only if you are creating a ring that doesn't move. If you want a dynamic body your only option is compound polygon shape (Body with few convex polygon fixtures). Compound polygon shape is a good idea for static ring too.

actionscript: creating a soft mask using vector shape

I have an hourglass like vector shape and I'd like to use it to mask an image. I'd like to feather the edges - have a soft falloff in transparency that follows the contours of the hour glass. Any ideas how I can do this?
I tried using a gradient fill on a closed shape (using beginGradientFill() and curveTo() functions) but that falloff doesn't follow the contour of the vector shape, it can only go one direction.
Maybe there is a better solution but until somebody comes up with it... I assume you could do the following:
Draw whatever shape you want to use as mask into a transparent bitmap.
Scale a bit the bitmap down (or use a matrix while drawing its bitmapdata).
Apply a blur filter to it.
Put the bitmap's center to the masked clip's center so they are aligned.
Set the masked clip's cacheAsBitmap property to true.

how to make a triangle button in flex using custom component?

I need a button that has a triangle shape.
how to make a custom component like a triangle button in flex?
what class should i override? updateDisplayList()? or layoutChrom()?
Depending on how complex you want the button to be you might be able to get away with using a process like this - except make the color outside the triangle the same for the 'clicked' and 'unclicked' states. Only change the color inside the triangle for the selected state.
If you need something more complex you can start with this or this for guidance.

how to set one continuous background image for multiple elements

I've been wrecking my brain trying to figure this out. is there any way to set one background image in css for multiple elements? I have a square-ish speech bubble, made with regular css, the triangle made with the border technique, but i want an background image to fill them both so it looks like a cut out all together.
I dont know any other way to design a solid shape using html/css other than squares and rectangles. If i could create a speech bubble as one solid shape, then giving it a bg would be simple lol.
I was wondering about html5's drawing capabilites, but im not sure...
Any ideas?
Edit: No, there's no option to do what you want. But if you wanna do spech bubbles, you can check any of these links:
http://nicolasgallagher.com/pure-css-speech-bubbles/demo/
http://konigi.com/tools/css-tooltips-and-speech-bubbles
http://desandro.com/resources/css-speech-bubble-icon/

Creating a canvas on top of an SVG (or other image)

The reason for asking this question is because I want to be able to draw an arrow between two svg images. I want to use canvas to create the arrows, so firstly I generate the svgs then place a canvas on top of them to be able to draw the arrows.
I've tried using style=... but haven't had any luck as everytime I add the canvas element it just pushes my svg images to another pl
If there's no easy way to do this I'll just create arrows using SVG, I figured it would be more efficient to use canvas if I had to do lots of arrows in a short amount of time.
You need position:absolute on the CSS for the canvas to take it out of the flow, and then you can layer it as you like using z-index.
However, I instead suggest that you can use one or two tiny canvases to create the arrowheads and use toDataURL() on them to create a url you can use for <image> tags in the SVG. This way all your graphics are in SVG but you can use the canvas for complex raster effects if you need to.
have you tried z-index? it's a useful css trick
#svgcontent
{
z-index:1
}
#html5content
{
z-index:3
}
EDIT: accidentally screwed the #s up. 'scuse me.