Re: Drawing polygon
Date: Thu, 13 May 2004 15:56:52 +0200
> What's the best way to draw a polygon with 4 corners in directdraw?
> I only see a DrawBox or DrawRectangle function. I've tried this gdi
> approach but it slows down the app.
> IntPtr dc=surface.GetDc();
> Graphics g=Graphics.FromHdc(dc);
This is a GDI+ approach. It might be faster to p/invoke the GDI
function Polyline, but it's still GDI and not DirectDraw. You can't use
DirectDraw to efficiently draw lines (although there is a DrawLine
method, but it uses GDI) unless you lock the surface and implement a
Bresenham line drawing algorithm or something yourself (which is
difficult in managed DirectX bacause of Lock bugs).
BTW: You need to dispose of the Graphics object before you release the DC.
- Re: DirectDraw CE6.0
... DDraw has primitives that are similar to what the hardware supports, ... you'll need to use the GDI ... the ability to select surfaces in hardware for page flipping etc if the ... device context to the DirectDraw Surface. ...
- Re: How do I make a brush paint tool in Direct3D (Or DirectDraw)
... Just like the brush tool I want to paint with nice soft edges. ... > The GDI+ I find annoyingly slow, ... Create a new control, let's call it Canvas. ... Using DirectDraw, it is difficult, since you need to use alpha blending ...
- Re: DirectDraw and GDI+
... > improvements of image filtering using DD7 instead of GDI+. ... > DirectDraw - don't hybrid the solution. ... do you think maybe a DirectDraw solution would be better ...
- Drawing polygon
... What's the best way to draw a polygon with 4 corners in directdraw? ... I only see a DrawBox or DrawRectangle function. ... I've tried this gdi ...
- Re: DirectDraw vs GDI
... DirectDraw won't improve the performance of drawing lines, ... text if there isn't any hardware acceleration on the platform. ... GDI at all. ... The GPE display driver source is shipped as part of ...