Sign in to follow this  
Followers 0
maestro

transparent gui visible gdi+

3 posts in this topic

Hi, this may be a strange request but I was wondering if its possible to make a transparent GUI have visible GDI.

So far I have been able to make the GUI transparent but the drawn GDI is also transparent, when I set the GUI transparency to 10 then i can see the GUI and the GUI picture but its faint,

is there any way to only show GDI drawings over everything else without showing the GUI?

This is what I have so far.

#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
#include <Process.au3>
OnAutoItExitRegister("_OnExit")


;GUI SIZING
Global $guisize = 1000
Global $resolution = 25

$gdigui = GUICreate("", $guisize + 1, $guisize + 1, 0, 0,-1, $WS_EX_LAYERED)
GUISetBkColor(0x000000,$gdigui)
GUISetState(@SW_SHOW)

_WinAPI_SetLayeredWindowAttributes($gdigui, 0x000000,50)

_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($gdigui)
$hPen_On = _GDIPlus_PenCreate(0xFFFF0000, 1, 5)
$hPen_Off = _GDIPlus_PenCreate(0xFF0000FF, 1, 5)




_GDIPlus_GraphicsClear($hGraphic) ;clears it just befor redrawing so it can draw with high accuracy

While 1

For $iY = 0 To $resolution-1
    For $iX = 0 To $resolution-1

        For $Y = 0 To $resolution-1
            For $X = 0 To $resolution-1
                If $X = $iX Or $Y = $iY Then
                Else
                $hPen_Think = _GDIPlus_PenCreate(0xFF&Hex(Random(0,376926741,1),6), 1, 5)
                _GDIPlus_GraphicsDrawLine($hGraphic,$iX* ($guisize / $resolution) + ($guisize / $resolution)/2,$iY* ($guisize / $resolution) + ($guisize / $resolution)/2,$X* ($guisize / $resolution) + ($guisize / $resolution)/2,$Y* ($guisize / $resolution) + ($guisize / $resolution)/2,$hPen_Think)
                _GDIPlus_PenDispose($hPen_Think)
                EndIf
            Next

        Next
    Next
Next

WEnd



Func _OnExit() ;cleans up gdi on exit.
    _GDIPlus_PenDispose($hPen_On)
    _GDIPlus_PenDispose($hPen_Off)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>_OnExit

Thanks,

Ilmaestro.


Hello, World!... LAME lol

Share this post


Link to post
Share on other sites



Change line 12 to: $gdigui = GUICreate("", $guisize + 1, $guisize + 1, 0, 0,$WS_POPUP, $WS_EX_LAYERED)

and line 16 to: _WinAPI_SetLayeredWindowAttributes($gdigui, 0x000000,255).

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Thanks a tone, works great.

I thought I was getting close :x

Thanks,

Ilmaestro.


Hello, World!... LAME lol

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