GetPixelColour with mouse magnifier

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Demivec
Addict
Addict
Posts: 4266
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: GetPixelColour with mouse magnifier

Post by Demivec »

Very nice Infratec. 8)

I have one small feature request. To be able to enlarge the magnification window, perhaps by some set sizes or using keypresses like Control + '+' (i.e. increases window size by some increment or selects next set size).
infratec
Always Here
Always Here
Posts: 7603
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetPixelColour with mouse magnifier

Post by infratec »

Hi,

I added keyboard shortcuts for the magnification and a small help with 'F1'

Bernd
infratec
Always Here
Always Here
Posts: 7603
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetPixelColour with mouse magnifier

Post by infratec »

Hi,

now I had the chance to test it with Win 7, and it failed :!:

After start, it was working for ~30s than it shows only FFFFFF as colour.

Solution:

I put the GetDC() and ReleaseDC() functions inside the main loop.
Now it is also working with win 7. :mrgreen:

Have I already told that I don't like windows ?

Bernd

P.S.:
But you have to change the default settings for the taskbar when you want to see the titles.
infratec
Always Here
Always Here
Posts: 7603
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetPixelColour with mouse magnifier

Post by infratec »

An other version:

In my office I detected that the program was not working with a 2 monitor solution.
I hope this is fixed now too.

Bernd
infratec
Always Here
Always Here
Posts: 7603
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetPixelColour with mouse magnifier

Post by infratec »

Hi,

since there was still a problem with multi screen scenarios,
I had to use again a windows API function.

Now it should work.

Bernd
infratec
Always Here
Always Here
Posts: 7603
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: GetPixelColour with mouse magnifier

Post by infratec »

Again me,

yes, the cursor mouse movement was not 100% accurate.
Sometimes one press was lost.

This depends on mouse_event_(). With relative moves it uses the mouse driver
and his acceleration function and that stuff.
So I decided to use the absolute setting of the position.
I also switched from mouse_event_() to SendInput_(), since mouse and
keyboard_event are marked as deprecated.

So it is also a good example for mouse control with SendInput_()

Bernd
Post Reply