Click here to Skip to main content
15,921,697 members
Home / Discussions / WPF
   

WPF

 
QuestionWindows Appl Pin
RishiKasnia20-Nov-08 1:35
RishiKasnia20-Nov-08 1:35 
AnswerRe: Windows Appl Pin
Pete O'Hanlon20-Nov-08 2:26
mvePete O'Hanlon20-Nov-08 2:26 
QuestionMultiple views Pin
Jozef Hopko19-Nov-08 0:00
Jozef Hopko19-Nov-08 0:00 
AnswerRe: Multiple views Pin
Gideon Engelberth19-Nov-08 3:25
Gideon Engelberth19-Nov-08 3:25 
GeneralRe: Multiple views Pin
Jozef Hopko19-Nov-08 11:52
Jozef Hopko19-Nov-08 11:52 
GeneralRe: Multiple views Pin
ColinM12319-Nov-08 17:40
ColinM12319-Nov-08 17:40 
QuestionCheckedComboBox Control in WPF Pin
aruna_koride18-Nov-08 16:18
aruna_koride18-Nov-08 16:18 
QuestionSilverLIght Initialization Error Pin
abeesmuhammed17-Nov-08 19:10
abeesmuhammed17-Nov-08 19:10 
AnswerRe: SilverLIght Initialization Error Pin
Ravi Bhavnani26-Nov-08 12:43
professionalRavi Bhavnani26-Nov-08 12:43 
QuestionWPF faster DrawingVisuals initialization. Pin
Polykar17-Nov-08 2:01
Polykar17-Nov-08 2:01 
AnswerRe: WPF faster DrawingVisuals initialization. Pin
lneir17-Nov-08 19:48
lneir17-Nov-08 19:48 
GeneralRe: WPF faster DrawingVisuals initialization. Pin
Polykar17-Nov-08 20:54
Polykar17-Nov-08 20:54 
QuestionGet element positions Pin
Not Active16-Nov-08 18:33
mentorNot Active16-Nov-08 18:33 
AnswerRe: Get element positions Pin
Michael Sync16-Nov-08 18:57
Michael Sync16-Nov-08 18:57 
GeneralRe: Get element positions Pin
Not Active16-Nov-08 18:59
mentorNot Active16-Nov-08 18:59 
GeneralLearning WPF Pin
ColinM12316-Nov-08 11:11
ColinM12316-Nov-08 11:11 
GeneralRe: Learning WPF Pin
Pete O'Hanlon16-Nov-08 11:18
mvePete O'Hanlon16-Nov-08 11:18 
QuestionDataGrid Pin
VisualLive16-Nov-08 5:33
VisualLive16-Nov-08 5:33 
QuestionAdvanced masking - Interlacing 3 video inputs into a single image [modified] Pin
Graeme_Grant16-Nov-08 2:14
mvaGraeme_Grant16-Nov-08 2:14 
AnswerRe: Advanced masking - Interlacing 3 video inputs into a single image Pin
Insincere Dave16-Nov-08 8:57
Insincere Dave16-Nov-08 8:57 
You can get close to what you need using an ImageBrush as the OpacityMask. In the example a 3px wide image is used and tiled and offset.

<Window x:Class="Interlace.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="771" Width="741">
    <Grid SnapsToDevicePixels="True">
        <Rectangle Width="600" Height="400" Fill="Red" x:Name="r"/>
        <Rectangle Width="600" Height="400" Fill="Green" x:Name="g"/>
        <Rectangle Width="600" Height="400" Fill="Blue" x:Name="b" />
    </Grid>
</Window>


private BitmapSource CreateMask(int size)
{
    WriteableBitmap bmp = new WriteableBitmap(size, 1, 96, 96, PixelFormats.Pbgra32, null);

    int[] mask = new int[size];
    int opaque = BitConverter.ToInt32(new byte[] { 255, 255, 255, 255 }, 0), transparent = BitConverter.ToInt32(new byte[] { 255, 255, 255, 0 }, 0);
    mask[0] = opaque;
    for (int i = 1; i < mask.Length; i++)
        mask[i] = transparent;
    bmp.WritePixels(new Int32Rect(0, 0, size, 1), mask, size * 4, 0);
    return bmp;
}


var mask = CreateMask(3);

RenderOptions.SetBitmapScalingMode(g, BitmapScalingMode.NearestNeighbor);
RenderOptions.SetBitmapScalingMode(b, BitmapScalingMode.NearestNeighbor);

b.OpacityMask = new ImageBrush(mask) {TileMode = TileMode.Tile, Viewport = new Rect(0,0,1.0/200,1)};
g.OpacityMask = new ImageBrush(mask) {TileMode = TileMode.Tile, Viewport = new Rect(1.0/600, 0, 1.0 / 200, 1) };


If you zoom in you should see red green and blue 1px stripes, try print-scrn.
If your using video I don't know what to expect, you say you want it pixel perfect but I would be suprised if you could handle 3 HD videos at the same time. I think nearest neighbor interpolation only got added in .NET 3.5 sp1 because of that dependency you might want to try a pixel shader instead, I had some success trying that.
Why can't you do the processing offline and just use a single video?
GeneralRe: Advanced masking - Interlacing 3 video inputs into a single image Pin
Graeme_Grant16-Nov-08 9:39
mvaGraeme_Grant16-Nov-08 9:39 
GeneralRe: Advanced masking - Interlacing 3 video inputs into a single image Pin
Insincere Dave18-Nov-08 5:56
Insincere Dave18-Nov-08 5:56 
GeneralRe: Advanced masking - Interlacing 3 video inputs into a single image [modified] Pin
Graeme_Grant19-Nov-08 1:35
mvaGraeme_Grant19-Nov-08 1:35 
QuestionWPF Binding to an attached property from a DataTemplate [modified] Pin
Mark Salsbery14-Nov-08 13:13
Mark Salsbery14-Nov-08 13:13 
AnswerRe: WPF Binding to an attached property from a DataTemplate Pin
Timmy Kokke14-Nov-08 13:46
Timmy Kokke14-Nov-08 13:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.