Sign in to follow this  
Followers 0
Lej

Magnifier problems

3 posts in this topic

#1 ·  Posted (edited)

I'm fooling around with a magnifier script (by Larry I think) and was trying to add a crosshair.

1. Problem is the crosshair is flickering because I first show the background and then add the crosshair. Is there anyway around this? Maybe it's possible to get the background and add the cross before drawing it? What would be even better would be if the magnified area showed the mouse cursor... Is there any way to get the files used as cursors in windows so you can use MouseGetCursor() to overlay a icon?

2. Another problem is that if I scroll to the edges of the screen the magnifying window will look a bit weird at the position it can't read colors from. Could one maybe fill this area with a single color instead?

3. What is the $SRCCOPY = 0x00CC0020 telling the dll in:

DLLCall("gdi32.dll","int","StretchBlt","int",$MyHDC[0],"int", _
        0,"int",0,"int",$winWidth,"int",$winHeight,"int",$DeskHDC[0],"int", _
        $l,"int",$t,"int",$readX,"int",$readY,"long",$SRCCOPY)oÝ÷ Ûáz趦±ç¦²Ú,¶n¥Ö­x-éxÊ)àÂ)Ý£"W­Ë-jw_¢¶°)^y¬!Èýz-¶­}©¢&«Â+a¶ v-övYl¢¥¦
ÞjÙrjkyȵçZºÚ"µÍÚ[ÛYH    ÓZØË]LÉÝÂÝÙ^]
    ][ÝÞÑTÐßI][ÝË    ][Ý×Ñ^]  ][ÝÊBÛØ[    ÌÍÔÔÐÓÔHHÐÌÛØ[   ÌÍÙ^]HÛØ[  ÌÍÝÚ[HÛØ[ ÌÍÝÚ[HHÛØ[    ÌÍÝÚ[ÚYHLÛØ[ ÌÍÝÚ[ZYÚHNLÛØ[   ÌÍÞÛÛQXÝÜHÛØ[  ÌÍÛ[UXÚÛÜÈHÈÜ[È[Û]ÜÙ^HÛXÚÜÂÌÍÙHÜ[  ][ÝÝÙÌ  ][ÝÊBÈÜX]HHÚ[ÝÈÈÜ^HXYÚYYY[XYÙHÛÌÍÙ]ÕÚ[[HHÜÚ^Û
    ][ÝÙ]ÕÚ[][ÝË  ][ÝÉ][ÝÈ    ÌÍÝÚ[ÚY    ÌÍÝÚ[ZYÚ   ÌÍÝÚ[   ÌÍÝÚ[KH
BÌÍÙ]ÕÚ[ÜÈHÚ[Ù]ÜÊ    ÌÍÙ]ÕÚ[[JBÈXZ[ÛÜHXYÛYYÈ[[ZYH[ÝÙH]ÛÜTÐÈÈÛXÚÙYÚ[HÝ  ÌÍÙ^]TÛY
L
BWÓXYÛYJ
BNÈ^]YZYH[ÝÙH]ÛÈÛXÚÙYRYÒÔÜÙY
    ][ÝÌ
    ][ÝË  ÌÍÙ
H[BWÑ^]

BQ[[[ÈÓXYÛYJ
BIÌÍÓ^RÈHØ[
    ][ÝÝÙÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÑÙ]É][ÝË   ][ÝÚÛ    ][ÝË  ÌÍÙ]ÕÚ[[JBRYÜ[]IÌÍÑÚÒÈHØ[
    ][ÝÝÙÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÑÙ]É][ÝË   ][ÝÚÛ    ][ÝË
BRYÝÜ[BIÌÍÞHH[ÝÙQÙ]ÜÊ
BBRYÝÜ[BBNÈÝ]ÚHÛX[XHÈHÚ^HÙHÜÚ^Ú[ÝÂBBIÌÍÜXYH    ÌÍÝÚ[ÚYÈ  ÌÍÞÛÛQXÝÜBBIÌÍÜXYHH   ÌÍÝÚ[ZYÚÈ ÌÍÞÛÛQXÝÜBBIÌÍÛH  ÌÍÞVÌHH ÌÍÜXYÈBBIÌÍÝH    ÌÍÞVÌWHH    ÌÍÜXYHÈBBQØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÔÝ]Ú ][ÝË  ][ÝÚ[ ][ÝË  ÌÍÓ^RÖÌK   ][ÝÚ[ ][ÝËÂBBBBL   ][ÝÚ[ ][ÝË  ][ÝÚ[ ][ÝË  ÌÍÝÚ[ÚY    ][ÝÚ[ ][ÝË  ÌÍÝÚ[ZYÚ   ][ÝÚ[ ][ÝË  ÌÍÑÚÒÖÌK ][ÝÚ[ ][ÝËÂBBBBIÌÍÛ ][ÝÚ[ ][ÝË  ÌÍÝ  ][ÝÚ[ ][ÝË  ÌÍÜXY    ][ÝÚ[ ][ÝË  ÌÍÜXYK   ][ÝÛÛÉ][ÝË    ÌÍÔÔÐÓÔJBBBNÈÜX]HHÛÛYÚÈ]ÈHXÝ[ÛÈÚ]BBIÌÍØÜÛÛÜHBBIÌÍÚÚHØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÛÛÉ][ÝË    ][ÝÐÜX]TÛÛYÚ  ][ÝË  ][ÝÚ[ ][ÝË  ÌÍØÜÛÛÜBBBNÈÜX]H[[XÝKÜ^Û[BBIÌÍÞHHBBIÌÍÞLHH    ÌÍÝÚ[ZYÚÌIÌÍÛ[UXÚÛÜÂBBIÌÍÞH ÌÍÝÚ[ÚYBBIÌÍÞLH ÌÍÝÚ[ZYÚÌÉÌÍÛ[UXÚÛÜÂBBIÌÍÚÛHHØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÛÛÉ][ÝË    ][ÝÐÜX]TXÝÛ][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÞK ][ÝÛÛÉ][ÝË    ÌÍÞLK    ][ÝÛÛÉ][ÝË    ÌÍÞ  ][ÝÛÛÉ][ÝË    ÌÍÞLBBBQØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÛÛÉ][ÝË    ][ÝÑ[Û][ÝË ][ÝÛÛÉ][ÝË    ÌÍÓ^RÖÌK   ][ÝÛÛÉ][ÝË    ÌÍÚÛVÌK    ][ÝÛÛÉ][ÝË    ÌÍÚÚÌJBBBNÈÜX]H[[XÝXØ[BBIÌÍÞHH  ÌÍÝÚ[ÚYÌIÌÍÛ[UXÚÛÜÂBBIÌÍÞLHHBBIÌÍÞH  ÌÍÝÚ[ÚYÌÉÌÍÛ[UXÚÛÜÂBBIÌÍÞLH    ÌÍÝÚ[ZYÚBBIÌÍÚÛHØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÛÛÉ][ÝË    ][ÝÐÜX]TXÝÛ][ÝË  ][ÝÛÛÉ][ÝË    ÌÍÞK ][ÝÛÛÉ][ÝË    ÌÍÞLK    ][ÝÛÛÉ][ÝË    ÌÍÞ  ][ÝÛÛÉ][ÝË    ÌÍÞLBBBQØ[
    ][ÝÙÙLÌ ][ÝË  ][ÝÛÛÉ][ÝË    ][ÝÑ[Û][ÝË ][ÝÛÛÉ][ÝË    ÌÍÓ^RÖÌK   ][ÝÛÛÉ][ÝË    ÌÍÚÛÌK ][ÝÛÛÉ][ÝË    ÌÍÚÚÌJBBQ[YBQØ[
    ][ÝÝÙÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÔ[XÙQÉ][ÝË ][ÝÚ[ ][ÝË  ÌÍÑÚÒÖÌK ][ÝÚÛ    ][ÝË
BQ[YQØ[
    ][ÝÝÙÌ  ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÔ[XÙQÉ][ÝË ][ÝÚ[ ][ÝË  ÌÍÓ^RÖÌK   ][ÝÚÛ    ][ÝË  ÌÍÙ]ÕÚ[[JB[[Â[ÈÑ^]

BIÌÍÙ^]HBQÛÜÙJ    ÌÍÙ
B[[
Edited by Lej

Share this post


Link to post
Share on other sites



I'm working on a similar program I started last week using the same base, Larry's AU3MAG.

Now I'm pretty new to this stuff also, but I'm on holidays and had the time to read quite a lot of stuff about that.

One thing: The flicker is not a good sign!

It might be o.k. in the boundaries of the desktop or when the pixelcolor underneath changes, but not for an idle at same position with no updates.

WinXP has a limit of 10.000 GDI handles per process and your script is simply running out of handles ... and that very rapidly. I was not able to have it running for one complete minute!

:lol:

I tried a quick hack of your script by moving the calls to get the HDC handles ($MyHDC, $DeskHDC) outside the func (did the job on mine) but the handles still increase. :whistle:

Now most of that stuff is black magic for me, too. And I am not familiar with the creation of brushes and rect's. Maybe this is the problem.

I don't have gdi call like those in my script and I can run it for many hours with never going above 100 handles.

From what I understand is that closing the GDI handles you opened may fail frequently (still in use or marked as such?!?!?) what will lead to the inevitable graphical death of your GUI.

But I am to much of a newbie in this area myself, that I am not the right person to help here.

If you search on Google for "GDI leak" you will see that you are in good company. :)

Share this post


Link to post
Share on other sites

Ok, did some test on your source and yep its the brush/rectangle creation part.

Even without the GDI handle issue I never managed to remove flicker.

Go for two labels instead. one for horiz. masking and one for the vert.

You can create them at GUI creation time and just resize them in the mag part if the screen boundaries were exceed.

Since the GDI stretch won't update the out-of-screen areas you will be totally fine there ... no flicker whatsoever.

I did some dirty hacks on my picker script, so if you really need some source example i have to extract sum before. jus tell me and gimme time to sleep first :whistle: since I have been up for quite some time and my mind starts to become jelly.

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0