![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | WPF Custom Drawing I plan on implementing the equivalent of something along the lines of the bandwidth meter or performance meter in task manager in a wpf control and was wondering where I should start. In the windows world, I'd inherit from UserControl, override onPaint, get a graphics context and starting painting. I'm having a bit of a problem grasping where to start in custom drawing my own control from scratch and was wondering if anyone could give me a few hints. I dont mind writing my own code, I know the actual painting part, I'll just change my pens stroke fill color etc... and draw the geometrys, but I dont have a reference to a surface to draw. Thanks in advance Weston |
| | #2 (permalink) |
| Guest | RE: WPF Custom Drawing karsten has already done this for you, and he updated it to latest bits. http://blogs.msdn.com/karstenj/archi...08/622982.aspx "Weston Weems" wrote: > I plan on implementing the equivalent of something along the lines of > the bandwidth meter or performance meter in task manager in a wpf > control and was wondering where I should start. > > In the windows world, I'd inherit from UserControl, override onPaint, > get a graphics context and starting painting. > > I'm having a bit of a problem grasping where to start in custom drawing > my own control from scratch and was wondering if anyone could give me a > few hints. > > I dont mind writing my own code, I know the actual painting part, I'll > just change my pens stroke fill color etc... and draw the geometrys, but > I dont have a reference to a surface to draw. > > Thanks in advance > Weston > |
| | #3 (permalink) |
| Guest | Re: WPF Custom Drawing Well actually that was exactly along the lines of what I was looking for, except I was looking to wrap this into my own custom control. So equivalent of onRender or onPaint I dont need to worry abotu getting a canvas and drawing everything manually by hand? I can just take base element, get drawing context and then start drawing geometry? Thanks Weston TheRHogue wrote: > karsten has already done this for you, and he updated it to latest bits. > > http://blogs.msdn.com/karstenj/archi...08/622982.aspx > > > > "Weston Weems" wrote: > >> I plan on implementing the equivalent of something along the lines of >> the bandwidth meter or performance meter in task manager in a wpf >> control and was wondering where I should start. >> >> In the windows world, I'd inherit from UserControl, override onPaint, >> get a graphics context and starting painting. >> >> I'm having a bit of a problem grasping where to start in custom drawing >> my own control from scratch and was wondering if anyone could give me a >> few hints. >> >> I dont mind writing my own code, I know the actual painting part, I'll >> just change my pens stroke fill color etc... and draw the geometrys, but >> I dont have a reference to a surface to draw. >> >> Thanks in advance >> Weston >> |
| | #4 (permalink) |
| Guest | Re: WPF Custom Drawing If you need to draw on a per frame level, like in DirectX, you would go this route: CompositionTarget.Rendering += new EventHandler(CompositeRendering); The CompositeRendering callback is called on a per frame basis. You can draw whatever you like into your canvas at this point using WPF geometry API's. You should find SDK material on the API. I have a 3D sample that uses this for per frame z-order sorting in my sample pack at http://www.therhogue.com/WinFX . "Weston Weems" wrote: > Well actually that was exactly along the lines of what I was looking > for, except I was looking to wrap this into my own custom control. So > equivalent of onRender or onPaint I dont need to worry abotu getting a > canvas and drawing everything manually by hand? > > I can just take base element, get drawing context and then start drawing > geometry? > > Thanks > Weston > > > TheRHogue wrote: > > karsten has already done this for you, and he updated it to latest bits. > > > > http://blogs.msdn.com/karstenj/archi...08/622982.aspx > > > > > > > > "Weston Weems" wrote: > > > >> I plan on implementing the equivalent of something along the lines of > >> the bandwidth meter or performance meter in task manager in a wpf > >> control and was wondering where I should start. > >> > >> In the windows world, I'd inherit from UserControl, override onPaint, > >> get a graphics context and starting painting. > >> > >> I'm having a bit of a problem grasping where to start in custom drawing > >> my own control from scratch and was wondering if anyone could give me a > >> few hints. > >> > >> I dont mind writing my own code, I know the actual painting part, I'll > >> just change my pens stroke fill color etc... and draw the geometrys, but > >> I dont have a reference to a surface to draw. > >> > >> Thanks in advance > >> Weston > >> > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| types.custom.ps1xml for custom members | hasten | PowerShell | 0 | 02-25-2008 08:30 PM |
| paintshop drawing etc | Mudnox | Vista General | 0 | 10-30-2007 07:17 AM |
| Drawing Packages | Andrew Aitchison | Vista General | 1 | 05-05-2007 05:16 PM |
| Drawing over title bar | Keith Patrick | Avalon | 5 | 03-31-2007 03:38 PM |
| Custom Dependency Property in custom class hierarchy not workingcorrectly?! | MueMeister | Avalon | 0 | 03-02-2006 06:19 PM |