How to select a window area ?

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Does one have any experience on how to select a screen area using the mouse and showing a transparent box of the area ?

I am doing a small graphical program as a self training, which displays a Mandelbrot fractal on a window. In a loop I would let the user select any area of the window to make a zoom on this area.

The usual way is to display the limit of selection while the user maintain the left button of the mouse until he / she releases it, and the to refresh the drawing window with the new selected area.

I made working the 'capture' part of the program to define at which point the user pushed the left button and the point at which the user releases. But I don't find a good way to display the selected area in the meanwhile.

If anybody is interested I can post the program source somewhere to co-work on it.

...

Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Just use StarDrawing(WindowOuput()) with an XOR mode (DrawingMode(xx)). So you can draw a line xor'ed which can be deleted just after by redrawing another line on it..

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Thnx Fred ...

I missed it was exactly what I needed. I used 2 | 4 for the XOR drawing and it's nice to see !

Rgrds

Francois Weil
14, rue Douer
F64100 Bayonne
Post Reply