Tech Off Post

Single Post Permalink

View Thread: I always get a black backgraound with DrawingContext in WPF
  • User profile image

    I'm learning a lot, My program now toggles between full screen and normal. The background dimensions are set like this:

     dc.DrawRectangle(Brushes.White, Nothing, New Rect(0, 0, System.Windows.SystemParameters.FullPrimaryScreenWidth, System.Windows.SystemParameters.FullPrimaryScreenHeight))

    so the background always appears to completely cover the window.

    But have a new question related to this. I want to be able to remove an object clicked on, or, change its position. I want to move it without having to remove it and redraw. I also need to know some positioning properties of the visual: x, y,height, width. Using dv in the key event: - dv.Offset.X and Y- just give me zeros, not the relative position. Google isn't helping me much here.