Re: How to do some GDI on top of Direct3D
- From: "Robert Janik" <robert_janik@xxxxxxxxxxx>
- Date: Sun, 19 Nov 2006 15:24:42 -0800
Disregard this message. I've already resolved the problem.
Using Direct3D + GDI in a window and several transparent GDI controls on top
of it is working without any problem. .NET Compact Framework is great!
"Robert Janik" <robert_janik@xxxxxxxxxxx> wrote in message
news:OZxw5dWBHHA.3928@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Does anybody have experience with GDI on top of Direct3D on Pocket PC?
I need to render 3D scene and after that do some GDI drawing, but it
flickers. Currently I'm using GDI to draw into a bitmap, I'm using
ImageAttributes to set transparent color and when I finish drawing I draw
bitmap to the graphics.
Example:
device.BeginScene();
...
device.EndScene();
device.Present();
graphics.DrawString(.....); // graphics is created by
Graphics.FromImage(bitmap)
...
e.Graphics.DrawImage(bitmap, this.ClientRectangle, 0, 0,
this.ClientSize.Width, this.ClientSize.Height, GraphicsUnit.Pixel,
imageAttr);
It is fast, but there is still flickering. I tried to use GetBackBuffer
and
do the drawing before calling Present, but I'm unable to get graphics, it
throws an exception
device.BeginScene();
...
device.EndScene();
Surface frontSurface = device.GetBackBuffer(0, BackBufferType.Mono);
graphics = frontSurface.GetGraphics();
// InvalidCallException at CDirect3DMobileSurface.GetDC()
frontSurface.ReleaseGraphics();
frontSurface.Dispose();
device.Present();
Does anybody know why I'm able to get backbuffer but not graphics by
calling
Surface.GetGraphics() ?
I know that I could use Sprite to render bitmap, but I would prefer to
access BackBuffer and draw directly into it.
Thanks for any help,
Robert
.
- References:
- How to do some GDI on top of Direct3D
- From: Robert Janik
- How to do some GDI on top of Direct3D
- Prev by Date: Re: Rotation
- Next by Date: Re: Rotation
- Previous by thread: How to do some GDI on top of Direct3D
- Next by thread: Cannot create Device for UserControl - Comapct Framework
- Index(es):
Relevant Pages
|