Re: Make rectangle with managed D3D
From: Jeremy Kimball (jkimball_at_rochester.rr.com)
Date: 03/14/04
- Next message: Jules: "Re: Newbie: How do I speed up Elevation grid viewing performance?"
- Previous message: Lynn Harrison: "Re: Newbie: How do I speed up Elevation grid viewing performance?"
- In reply to: Valentin: "Make rectangle with managed D3D"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 14 Mar 2004 18:54:55 GMT
You shouldn't need to lock the rectangle. Just grab the Graphics and draw,
then release the Graphics object.
"Valentin" <vbillotte@programmationworld.com> wrote in message
news:49a2fd46.0403140331.b4b559b@posting.google.com...
> Hi Everyone,
>
> I would like to draw a green rectangle on my back surface such as
> selection units in warcraft 3. I m now using LockRectangle with no
> problems.
> But the GetGraphics method fail.
>
>
> Here is a code snippet:
>
>
> BackSurface = device.GetBackBuffer(0, 0, BackBufferType.Mono);
>
> Rectangle dock=new Rectangle(new Point(0,0), new Size((int)this.width,
> (int)this.height));
>
>
> BackSurface.LockRectangle(LockFlags.None);
>
> Graphics g = this.backSurface.GetGraphics(); // Exception thrown here.
>
> g.DrawRectangle(System.Drawing.Pens.Green, 20, 20, 100, 100);
>
> BackSurface.ReleaseGraphics();
>
> BackSurface.UnlockRectangle();
>
>
>
> Can i resolve my problem?
>
> Thanks for your help
>
>
> Valentin
- Next message: Jules: "Re: Newbie: How do I speed up Elevation grid viewing performance?"
- Previous message: Lynn Harrison: "Re: Newbie: How do I speed up Elevation grid viewing performance?"
- In reply to: Valentin: "Make rectangle with managed D3D"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|