News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to keep the Device Context unchanged?

Started by xandaz, July 26, 2011, 04:33:25 PM

Previous topic - Next topic

xandaz

   Well thanks qword.... this is what i had done. I see that some of what you added is kind of better than what i did. I counldnt go around the region stuff when it relatesto filled spheres and also your segments work better than mine. You select a standing point and then grow the segement to wherever the mouse is going. Its good. Thanks a lot. See my stuff pls and say what you think.

xandaz

   I'm trying to understand why some of the figures dont stick to the DC. I don't fully understand what you did in xandaz_paint. Why does it take all those DC's. I took what i think to understand of the things you did. I created an alternate DC to draw the figures and then redraw the bitmap so that theres no dragging when a specific figure is growing. look at q.
   I'd also like to say that you're pretty good at this Qw.
   Thanks and best regards.

qWord

hi,
while handling WM_PAINT,you must use TransparentBlt() to draw the preview (hTDC) to the screen. When the right mouse button releases (WM_LBUTTONUP), it is necessary to merge the preview layer hTDC with the memory DC hMemDC - this must also done using TransparentBlt(). After merging, the preview layer hTDC must cleared with the transparent color and the window must be invalidtaed.
Also:
- you do not delete object, if not longer needed (CreatePen)
- the BitBlt,..,10000,... was only example - you should use the bitmap's size.
- genrally: stay away from global variables - especially in context to your MDI stuff.

qWord
FPU in a trice: SmplMath
It's that simple!

xandaz

   Qw... i'm really sorry for being so presistent. What do is to merge the bitmap in hTDC with hMemDC using transparent blt and then the bitmap in hTDC using the transparent color which should be the color actually being used to draw right? I was looking at your example and it is very complicated to understand. Thanks for all the help Q.
   Best regards from X. :U

qWord

hi,
in the attachment a simpler example with comments.
FPU in a trice: SmplMath
It's that simple!

xandaz

   thanks a lot Qw. I'll check it out. ty ty and nite

xandaz

    well....thanks Q. It was hard to understand but things are finally settling down. Thanks a lot.