MFC-a windows paint example, how do i do the text option
-
like on windows paint, the text feature, where it places text anywhere on the painting surface, how would i do this ? and then, how would i add resizing properties to my rectagles lines and ellipses thanx smile...its your destiny :)
CDC::TextOut() or any of the other variants. For the resizing you will have to hit test the mouse click against the list of items you draw, if it is within your hit test bounds then you have a hit and move to editing mode for the item. Store the details that you use to draw the item, and as the mouse moves, erase the item as it was, quick way to do it is via an XOR drawing operation. Draw the new item at the new position. On mouse up, commit the new positions to the store. You will have to worry about which item to select on the hit test. Think of each item being created as being on a stack, hit-test working down the stack. If two items are possible hits, then it is the more newly created (ie on top) item that will be selected. then you will have to do a move to back, bring to front mechanism, but that is simple. HTH, Steve. if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk)) { // I aint no pUnk bitch! }