Texteffects in wpf - wpf

I would google this question, because I'm certain that it has been answered, but I just don't know how to describe it in words.
I want to make buttons in wpf, like the ones in the picture below. Step 1 would be to just make a white block and make it transparent. Step 2 would be to have a text that "delete/mask/clip/blends" the area that it "touches" on the white box. Where the text touches the white box I want the white box to have 100% opacity. I don't know how to google step 2, thus I came here.
Is this even possible to do in wpf, and if not, any other ideas?
Picture of the graphical mock up
Edit: sorry for bad title

Related

winforms messagebox background colour

I am new to winforms and I want to keep things simple
When I create a message box: I notice the top half is white background while the lower half is grey (!!!)
(what I really want is all background white).
But even the VisualStudio dialog doesn't behave this way
Can someone please help me?
Do I need to write some custom code ?
I would post the image but not allowed;(
Thanks
MessageBoxes are displayed by the operating system. If the options that are available aren't good enough, then you have to make your own form.

How to highlight portion of a Rich TextBox WPF control if there are more than 2 spaces?

I have a richtextbox control in my WPF 4.0 application. Now suppose I have a text like
"hello how [space][space] r u? [space][space] I am fine"
As can be noticed that there are two gaps between how and r as well as between ? and I.
When this will happen then the portion will be highlighted with green e.g. how ..r and from ? to I will be highlighted with green color.
i.e. if the space between two words are more than 2 then that will be highlighted with green.
Is it possible to do in WPF RichTextbox control? If so, please help me in writing so. As of now what I have done is that I have only able to find out the distance of spaces between two words.
Note:~ [Space] means the white spaces. Since the gap was not prominent(as it was not coming in the editor), that's the reason I made it like so.
Thanks
WPF4.0/ C#4.0
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7c9a622a-4e3b-451e-bc4c-ab9d011447e0
Here is a progressive scenario featuring RichTextBox highlighting multiple ranges, it may lead you on the right path.
He ends up getting it to work, but you will have to modify it to recognize white space perhaps.

Making a "Fuzzy border" in Silverlight 3.0

I would like to have fuzzy looking border around my Canvas control. Basically, I am creating a Print Preview screen, and I want it to look almost exactly like the one in Word 2010. In this, there is a thin gray line, a thin orange line and then a fuzzy gradient around the outside of the page. Check it out and you will see what I mean.
Can anyone tell me how I can do this with my Canvas control?
Answer was in the comments. Thanks!
Here it is:
Does SL3 support BitmapEffects or ShaderEffects? If so, just drop a border on the bottom and give it a fuzzy effect. Just make sure not to put anything IN the border, just lay it on top of the border inside the canvas.

Some animation requests in a Silverlight application

I am making a flash card application. It shows the question and then a textbox for user input, all wrapped in a border or rectangle. So what I want is an animation that "flips" the rectangle or border upside-down and then their is text on the "back". Also, I want my application to APPEAR transition from one card to another by "flying off" the screen then "another" card comes in to replace the other one in the opposite direction. But actually I'm want just a little animation of the border or rectangle moving off the screen then coming back in, but in the opposite direction. Some help would be appreciated, like what kind of animation can accomplish this and maybe a small code sample to demonstrate. I am not asking you write all this, I think that would be a little rude (unless you really want to).
Have you had a look at the Silverlight FX stuff? There might be some animations in there that are what you are looking for. There are also samples provided.
http://projects.nikhilk.net/SilverlightFX
Michael

Ensure text remains always readable in Silverlight

We have a Silverlight application that shows text over video. Both the text and video can be considered variables. Sometimes we might have a dark video, sometimes a bright video, sometimes a video that has sections of both.
Think of credits at the end of a movie. We want to ensure the end user can always read the text being show over the video. The text is always an overlay on top of the video.
The simple solution is to two show the text twice once in white and once in black with a small offset. This almost works but actually looks a little rough, and takes away from the user experience.
Ideally we would have the text with slight semitransparent glow around the edges. So if the text were white there would be a black glow right around the edges.
Is there a way to do this? Or is there an equal or better work-around?
I've done this with the DropShadow pixel shader effect in Silverlight 3. It works nicely, but since the pixel shaders aren't executed on the hardware, it can have a pretty heavy impact on the performance of the application.
If you wanted to get ambitious, you could write your own pixel shader. Silverlight 3 supports HLSL Shaders.
You could try displaying it with a contrasting outline, rather than just a "drop shadow" like you get if you display it once with a small offset. To do this, display it four times in one color, then a fifth time with a contrasting color, centered over the four previous copies. The four first ones should be offset one pixel up, right, down and left of the center.
The net effect should be an outline. Of course, perhaps this too looks "rough", since it's computer-generated and thus not perfect with respect to issues like kerning, spacing between characters, and so on. But it's quick to try, at least.
In general, automatically finding good contrasting colors when the background is video sounds a bit difficult. In the worst case, the video contains text just like the one you want to display. The correct solution in that case is hard to imagine.
Sounds similar to the problem of ensuring subtitles are always readable in films/TV. The most robust, but not necessarily most elegant solution, is to have a coloured background rectangle for the text which is either opaque or has a low transparency value - often grey or black with good contrasting foreground colour.

Resources