Board index » cppbuilder » Re: Two canvases obstructing each other?

Re: Two canvases obstructing each other?


2003-07-05 01:01:13 PM
cppbuilder6
Martin,
I've never run into this problem, but I always query for the screen's DC
right before starting a drag operation (e.g., in OnMouseDown). Where in
your code are you setting MyScreenCanvas->Handle? You might also try
calling LockWindowUpdate() for the PaintBox's Parent window before starting
the drag operation. Also, you might consider using a TImageList's
drag-and-drop features to create and move the drag image; it's translucent,
but it handles all of the screen-drawing details. Another easy alternative
is to place a TImage upon a TPanel, load the TImage with your drag image,
and then move the Panel.
Good luck,
--
Damon (TeamB)
BCBCAQ - bcbcaq.bytamin-c.com
Quote
Rupprecht wrote:
I'm using a canvas to draw the picture of a object while dragging it:
[snip]
I start to drag after the drawing of the paintbox it seems as if
MyScreenCanvas has been 'turned off'...
 
 

Re:Re: Two canvases obstructing each other?

Hello Damon,
many thanks for your help. I set MyScreenCanvas->Handle in OnMouseDown
but as I wrote before, when I press the mouse button and a refresh of
the paintbox occurs (caused by a timer) before I make some mouse move
(then a flag would be set to suppress any refresh) it seems as if
MyScreenCanvas gets taken away it's screen's DC. All functions are
executed but no drawing takes place. Besides, how do you query for the
screen's DC? Can I test MyScreenCanvas->Handle in any way? To call
LockWindowUpdate() means to call LockWindowUpdate() e.g. for a panel
that is parent of the paintbox?
Again, thank you for your assistance,
Martin
Damon Chandler (TeamB) wrote:
Quote
Martin,
I've never run into this problem, but I always query for the screen's DC
right before starting a drag operation (e.g., in OnMouseDown). Where in
your code are you setting MyScreenCanvas->Handle? You might also try
calling LockWindowUpdate() for the PaintBox's Parent window before starting
the drag operation. Also, you might consider using a TImageList's
drag-and-drop features to create and move the drag image; it's translucent,
but it handles all of the screen-drawing details. Another easy alternative
is to place a TImage upon a TPanel, load the TImage with your drag image,
and then move the Panel.

Good luck,