# Color fill is not working

This topic is 4697 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
My first guess would be that oTmpSurf is not valid. Was it?

##### Share on other sites
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

##### Share on other sites
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.

1. 1
Rutin
21
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 13
• 38
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631714
• Total Posts
3001867
×