Color fill is not working

Started by
2 comments, last by EnochDagor 18 years, 7 months ago
VB.NET using DX9. I have the following code:

        Dim oRect As Rectangle = New Rectangle(Left, Top, Width, Height)
        Dim oTmpSurf As Surface = oDevice.GetRenderTarget(0)
        oDevice.ColorFill(oTmpSurf, oRect, System.Drawing.Color.FromArgb(255, 64, 128, 192))

The code breaks on Colorfill saying that I have an invalid call... any ideas why? I checked oTmpSurf in the debugger and it is coming back as a Default pool object. Thanks in advance.
Enoch DagorLead DeveloperDark Sky EntertainmentBeyond Protocol
Advertisement
My first guess would be that oTmpSurf is not valid. Was it?
Chris ByersMicrosoft DirectX MVP - 2005
Have you tried running your application with the debug runtimes? they are usually pretty good at giving you good information as to what/why things are exploding [grin]

Have a look at the link in my signiture if you haven't used the debug runtimes before...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

No, found the problem. When I went to check the surface I was writing a message to your reply (thanks for the reply btw). The surface was 608x800 or something like that because I was running in windowed mode. The rectangle defined an area beyond those dimensions... namely 100x100 for x,y and 600x600 for width and height.

So... got that fixed.
Enoch DagorLead DeveloperDark Sky EntertainmentBeyond Protocol

This topic is closed to new replies.

Advertisement