   need help on using brush
  Hi, i''m writing a WIN32 applications with VC++.i want to colour a funny shape area (e.g. randomly place 4 different triangles inside a square, and i want to colour the remainning area).i only know those basic functions e.g. HPEN, HBRUSH, ellipse, rectangle, LineTo.... etc.....***PS*** the example is not really the case, dont tell me to colour the square 1st and then put the triangles in..... ;-) 
  So what''s the question/problem? ;  the question is i cant colour it......i can sort of define the area it not in a regular shape, and i dont know the function to colour it......i only know how to colour those standard objects with those basic functions.....thanks for repling so quick.... :D ;  triangulate the remaining area and then use what you use for drawing triangles to color it ;  I don''t think I''m undersanding it now...but here we go...As far as filling, make a brush, either with GetStockObject if it''s a common color, and then select it onto the device context with SelectObject. It''s just like Pens, which you seem to have used before. ;quote:Original post by Airo  triangulate the remaining area and then use what you use for drawing triangles to color it   the exact situration is a guy walking around an object and i want to colour the area behind the object, like a shadowing effect. The area would be random and needed to be sorted out in real time.... so..... i dont want to do it in ur way, but thx ;  I think I''ve got it now (I hope). What you want to do is draw the rectangle first, and then draw everything extra atop that, so any open areas will show through back to the rectangle. ;  Provided you can find pixels that aren''t inside the enclosed areas, ExtFloodFill() could work.  Look it up.But be careful because it probably won''t handle situations like this:-----------------------------|  ||  ||  ||  ||  /\   || /  \  ||/   /  ||\  /   ||x\/    |-----------------------------  Assuming that the smaller shape actually touches an edge (as is not really apparent in my ASCII art), the flood fill will not reach the spot marked ''x''.  So if you can find all of the spots that need filling, ExtFloodFill will work for you.  But if you can find them all, you could probably write your own flood-filler... Hmm...-Auron ;  thx i''ll try it out 