tks a lot for your post Mr.'G'....really appreciate your help and time...
Quote:
First of all, don't even think about using FloodFill. FloodFill is a function to fill an arbitrary shaped region. It uses a recursive algorithm which scans the DC line by line, and is highly inefficient compared to FillRect(). So stay with FillRect() for filling rectangles.
ok...i will..:)
Quote:
To get your updating and drawing to work, first remove the CMemDC stuff, as it obscures what is really happening. Without the offscreen drawing, you will see much better what is going on. Furthermore, you will note that you don't need offscreen drawing in order to remove flicker for your application.
done...looking forward to see that and learn:)
Quote:
Next, remove your implementation of OnEraseBkgnd (or call the base class implementation). You will definitely need to erase the background.
done..
Quote:
Now to your updating problem: Note that UpdateRect() expects the rect in device coordinates, you are passing logical coordinates. So create a CClientDC, set the mapping mode to MM_LOENGLISH and use LPToDP to convert the rect to device coords (the same way you did in OnLButtonDown).
i already did that...:(
its in my OnUpdate handler....:confused:
Quote:
Next, fix the bugs in CEditorDoc::SetSquareColor(). You are always returning the same rect, build it from x1, y1, x2, y2 instead. Note that you also have i and j swapped.
done the SetSquare part...but the swapping issue...i THINK its ok now...??:confused:
Quote:
If you compile and run your app now, you will note that it works fine (albeit slow): Any field you click will be repainted without any flicker.
it doesn't....:(
onluy some fields can be painted... rest canti dont understand whats happening...:(
some fields cant be painted....:eek:
Quote:
Take into account the clipping region when drawing the rectangles. The easiest way to do it is to call pDC->IsRectVisible(). So inside your loop, for every rectangle you get, test whether it is actually visible (meaning: it is inside the clipping region) and create the brush and call FillRect() only if this is the case. You will now note that your app runs fine as before, only much faster. (To speed things further up, you should also draw the grid lines only if they fall into the clipping region).
i have no idea hopw to do this..i know maybe its something regarding getClipRect..i read MSDN..but i have no idea how to use it in my codes....:(please help....