Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9275067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:30:07+00:00 2026-06-18T16:30:07+00:00

I have a <Rectangle /> on my Windows phone app view which displays the

  • 0

I have a <Rectangle /> on my Windows phone app view which displays the camera feed, and I am trying to figure out the XAML code to place a partially transparent image over the feed.

I have the working code:

<Grid x:Name="LayoutRoot">

        <Rectangle x:Name="_previewRect" 
                   Margin="0" 
                   Height="800" 
                   Width="600" 
                   HorizontalAlignment="Center" 
                   VerticalAlignment="Center"
                   Tap="OnTapDown">

            <Rectangle.Fill>
                <VideoBrush x:Name="_previewVideo">
                    <VideoBrush.RelativeTransform>
                        <CompositeTransform  
                            x:Name="_previewTransform" CenterX=".5" CenterY=".5" />
                    </VideoBrush.RelativeTransform>
                </VideoBrush>
            </Rectangle.Fill>

       </Rectangle>

    </Grid>

Which displays my camera feed perfectly (most of that code is in codebehind of course).

But now I would like to add an image as an overlay. I tried adding:

<Grid.Background>
    <ImageBrush ImageSource="Images/Background/BackgroundBlurred.png" Stretch="UniformToFill" />
</Grid.Background>

both above and below the <Rectangle /> element, but no such luck.

Does anyone have any idea how I can do this? It doesn’t seem terribly difficult, but I’m just beginning to learn XAML.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:30:08+00:00Added an answer on June 18, 2026 at 4:30 pm

    If you want an Image to overlay over the video-feed Rectangle, you must make it a separate control within the “layoutRoot” Grid. Simply position it directly over the top of your rectangle and give it a higher Canvas.ZIndex value:

    <Grid x:Name="LayoutRoot">
        <Rectangle x:Name="_previewRect" 
                   Margin="0" 
                   Height="800" 
                   Width="600" 
                   HorizontalAlignment="Center" 
                   VerticalAlignment="Center"
                   Tap="OnTapDown"
                   Canvas.ZIndex="1">
            <Rectangle.Fill>
                <VideoBrush x:Name="_previewVideo">
                    <VideoBrush.RelativeTransform>
                        <CompositeTransform  
                            x:Name="_previewTransform" CenterX=".5" CenterY=".5" />
                    </VideoBrush.RelativeTransform>
                </VideoBrush>
            </Rectangle.Fill>
        </Rectangle>
    
        <Image x:Name="myOverlayImage" Canvas.ZIndex="2">
            <!-- Your overlay is now a sibling of the video-feed Rectangle, but drawn on top of it -->
        </Image>
    </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code : System.Drawing.Rectangle desktop_Rectangle = System.Windows.Forms.Screen.PrimaryScreen.Bounds which gives me the
I have a problem with a class which extends ListBox in Windows Phone 7
I am trying to draw a rectangle on a windows mobile phone. Draw the
Im building an app for Windows phone 7. I have a panorama page with
I have a Windows (XP) application which needs to display a two-dimensional rectangle within
My environment is windows phone 7.1. I have the following code: <ListBox ItemsSource="{Binding Path=Items}">
I have a program in C# (Windows Forms) which has a rectangle on a
I have a rectangle which has known width and height.Now devide rectangle diagonally to
I have a windows form which contains a user control. This user control has
I have a Windows Mobile application (C#, .Net framework 2), the codebase of which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.