Took me a while to explore into your suggestions
Main Topics
Browse All Topics Hello
I'm making an application in which I want to display some waveforms. I know how to do this in GDI+, but thought that because sometimes the GDI+ is slow and because I need to display the waves in realtime, I should use managed DirectX. I don't need to use fancy 3D graphics just 2D with a bit of zoom in and zoom out.
So I've started out drawing my grid. The grid will be an outline of the window with 10 horizontal and vertical lines intersecting the window.
DirectX doesn't make it easy drawing lines and such. I miss the ease of the DrawLine method of the GDI+.
Anyway to draw the grid I'm using a VertexBuffer and some CustomVertex objects in which i define my grid points.Then I use DrawPrimitives i.e PrimitiveType.LineStrip to draw the outline of my grid.
After all that I got a rectangle drawn and some lines intersecting it along the horizontal and vertical.
But how do I change the line thickness? Is there an easier way to go about this? Any suggestions on the overall implementation using DirectX and some general advise on how to go about it.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: davebytesPosted on 2005-07-01 at 22:01:13ID: 14352777
Hmmm... it's been a while since I've tried to do something at the level you describe. And DX9 changes things a bit.
I believe DX doesn't support varying line thicknesses (but I don't use lines ever). If you want real control, you can implement lines using stretched quads to have complete control.
Alternate approaches:
It used to be you could create a texture surface and get a GDI DC to the surface, use GDI calls, unlock/release the DC, and then render the texture to the 3D scene. I'd have to dig deeper into DX9 to see if that's all still available.
If not, at the least you could still use GDI with a compatible pixel format, and lock a texture and memcpy the pixels into the texture.
-d