Sign in to follow this  
Followers 0
dantay9

GDI and Picture

8 posts in this topic

#1 ·  Posted (edited)

I want a GUI window to look like the uploaded picture with another picture on top of it. I was just wondering if there was any way to clear up the white space around this image or any way to duplicate the results.

post-45252-1243796516_thumb.png

Weather.au3

Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try this:

#include <GdiPlus.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Global $nWidth = 400, $nHeight = 500
Global $aPoints[4][8] =[[30, -10, 5, 5, -10, 30, 0, 0], _
                        [$nWidth-30, -10, $nWidth-5, 5, $nWidth+10, 30, $nWidth, 0], _
                        [30, $nHeight+10, 5, $nHeight-5, -10, $nHeight-30, 0, $nHeight], _
                        [$nWidth-30, $nHeight+10, $nWidth-5, $nHeight-5, $nWidth+10, $nHeight-30, $nWidth, $nHeight]]

$Gui = GUICreate('Pic', $nWidth, $nHeight, -1, -1)
GUISetBkColor(0x0000FF)
GUISetState()
_GDIPlus_Startup()
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($nWidth, $nHeight, $hGraphic)
Global $oBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
;~ _GDIPlus_GraphicsClear($oBuffer, 0xFF0000FF)
_GDIPlus_GraphicsSetSmoothingMode($oBuffer, 4)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)

GUIRegisterMsg(0xF, "MY_PAINT")
GUIRegisterMsg(0x85, "MY_PAINT")

_DrawAngle($aPoints, 0)
_DrawAngle($aPoints, 1)
_DrawAngle($aPoints, 2)
_DrawAngle($aPoints, 3)
Sleep(100)

_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)


Do
    Sleep(10)
Until GUIGetMsg() = $GUI_EVENT_CLOSE


Func _DrawAngle($aPoints, $nIndex)

    Local $nPoints[5][2]
       $nPoints[0][0] = 4
       $nPoints[1][0] = $aPoints[$nIndex][0]
       $nPoints[1][1] = $aPoints[$nIndex][1]
       $nPoints[2][0] = $aPoints[$nIndex][2]
       $nPoints[2][1] = $aPoints[$nIndex][3]
       $nPoints[3][0] = $aPoints[$nIndex][4]
       $nPoints[3][1] = $aPoints[$nIndex][5]
       $nPoints[4][0] = $aPoints[$nIndex][6]
       $nPoints[4][1] = $aPoints[$nIndex][7]
       _GDIPlus_GraphicsFillClosedCurve($oBuffer, $nPoints, $hBrush)
EndFunc

Func MY_PAINT($hWnd, $msg, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
    Return $GUI_RUNDEFMSG
EndFunc ;==>MY_PAINT
Edited by oMBRa

Share this post


Link to post
Share on other sites

That isn't exactly what I want. I had everything I needed except that white ring around the weather picture needed to go away. How do I get rid of the ring around the weather picture?


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

That isn't exactly what I want. I had everything I needed except that white ring around the weather picture needed to go away. How do I get rid of the ring around the weather picture?

lol Sorry I have missread, basically you want a gui with a blue background?

Share this post


Link to post
Share on other sites

I want a gui with a blue background. Then I also want the pictures on top of it to not have that white ring. If you run the code from my first post, you will see that the weather picture has a white ring around it. I don't like that. Can you get rid of the white ring around the weather picture?


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

it works fine for me, I dont have any white spaces

EDIT: I see what you mean, I dont think you can get rid of it

Edited by oMBRa

Share this post


Link to post
Share on other sites

OK. Thanks for letting me know.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

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