Jump to content

Recommended Posts

Posted

Hello

I want to draw a circle on a background picture but i want transparency in it. Is there an easy way to do it?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>

$Form1 = GUICreate("Form1", 735, 121, 192, 124)
GUISetState(@SW_SHOW)

_GDIPlus_Startup()
$hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\shit.bmp")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($Form1)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)

$ellipse = _GDIPlus_GraphicsCreateFromHWND($Form1)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFE0A0FF)
_GDIPlus_GraphicsSetSmoothingMode($ellipse, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
_GDIPlus_GraphicsFillEllipse($ellipse, 10, 10, 40, 40, $hBrush)
Posted

I could also use a colored rectangle picture instead of _GDIPlus_GraphicsFillEllipse if that would be easier. 

Posted

Oh god.... I didnt even realize there was an alpha channel in it. That's what happens when you copy from the examples without looking for every detail. Shame on me.
Thank you.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...