Drawing DirectX surface to an Image (possible?)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Anyone know if it's possible to get a directx device to draw to an
Image instead of a control/form handle?

I've been given a task that seems harder than it looks.. I have a form
which contains no controls, and draws everything in the OnPaint event.
I need to draw directx output during the OnPaint in the graphics object
(don't ask why)... I tried dynamically creating a panel and adding it
to the form, but it flickers horribly because of other things drawn
during the OnPaint event. I'm not sure how get the panel to draw itself
after other things are drawn on the form, it just flickers badly. I'm
gonna try clipping the area but I would rather draw in an area on the
form itself instead of adding a panel control and passing the
handle....


Hopefully I explained that properly lol...


-Mike

.



Relevant Pages

  • Re: Drawing DirectX surface to an Image (possible?)
    ... Image instead of a control/form handle? ... and draws everything in the OnPaint event. ... I need to draw directx output during the OnPaint in the graphics object ... I tried dynamically creating a panel and adding it ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Animating one object moving in front of another
    ... Disclaimer: I haven't learned anything about WPF yet, and I've heard that it provides better, more-direct support for animation. ... object, copy it, draw the front object on the original, render it to the screen, then reload the copy of the background for the next loop. ... Inside the OnPaintmethod then, you'll just copy your entire background image to the control as desired (if your background image doesn't fill the entire control/form, you'll also have to do a Graphics.FillRectangle() or similar to clear out the rest of the background). ... All that cloning is just going to slow things down, as is the creation of a new Graphics instance and allocation of a second BufferedGraphics instance. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: GDI+ Clip Region allows 0.0f width pen to draw through
    ... Just to make this more outrageous if you draw the vertical lines from the ... I took the previous code I posted and made the panel anchor to all four ... private void panel1_SizeChanged ... In other words create a rectangle that is a wider than the panel. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Draw over controls
    ... want to draw a rectangle over everything. ... The problem is because I have to pass the rect ... of the panel, it draws on that, and under the other controls. ... You shouldn't really draw outside Paint events, because other controls ...
    (microsoft.public.dotnet.languages.csharp)
  • Rectangle in pixel, user coordinates in mm, TODO-draw the points correct.
    ... If rectangle is ok, which define zero point, draw. ... // Pixel vom Panel ermitteln ... int pixelLeft = panelInput.Left; ... g.DrawRectangle(Pens.Red, FactorZollMillimeter * abmessungen.X1, ...
    (microsoft.public.dotnet.languages.csharp)