Jump to content

Gui With image for backgroup


Recommended Posts

First i would like to say you guys rock here,and thanks in advance for the help.

Here is my problem, Im not a programer, Im a complete NOOB to this stuff, and I NEED HELP! lol

Here is what i got. Below is an Image for a GUI i would like to create where the numbers, pound key and asterisk are

all clickable as invisable buttons for my GUI. When done i would like to hit a Submit button, (not in image yet) to submit a numeric key to an encrypted file to decrypt it, and finally would like it to reencrypt it when i close the GUI.

Issues:

1. How do i make a GUI that has the image as a background, image is a transparent GIF

2. How do i set what i want for the password

3. how do i make it reencrypt when done

i KNOW how to do send keys, and key presses, and the like, but this is the first ever GUI for me.

Any help with coding this would be cool, but the biggest help would be a link to a sample that might answer my question, i tried looking through the forums and wasnt sure what im actually looking for.

Again thanks for the help.

Kevinpost-66553-0-93705200-1312580326_thumb.g

Link to comment
Share on other sites

Hi and welcome and thank you for the praise.

1-Maybe using different pics and using GDI plus if you want transparencies or just an Pic ontrol(also have tranparencies but inside the GUI, not the background of the GUI).

For The GDI Plus example look at this

#include <GDIPlus.au3>
#include <Constants.au3>
; This Is For Getting The PNG From a URL, You can avoid this or learn from it, you decide ;)
$PngFile = @ScriptDir & "\MyPNG.png"
$FileSize = InetGetSize("http://img26.imageshack.us/img26/7439/boton3p.png")
$Inet = InetGet("http://img26.imageshack.us/img26/7439/boton3p.png", $PngFile, 0, 1)
Do
    Sleep(100)
    ToolTip(InetGetInfo($Inet, 0) & " / " & $FileSize, 0, 0)
Until InetGetInfo($Inet, 2)
ToolTip("")

;Here is the GUI creation
$hGUI = GUICreate("PNG Pic by monoscout999")
GUISetBkColor(0x123456, $hGUI) ; this is to test the transparency, chang the color you want
$Pic = GUICtrlCreatePic("", 10, 10, 50, 50)
_SetPNGIntoPicControl($Pic, $PngFile)
GUISetState()

While True
    $msg = GUIGetMsg()
    Switch $msg
        Case -3
            Exit
        Case $Pic
            MsgBox(0, "test", "You clicked in the Pic Control")
    EndSwitch
WEnd

; Here is the function declared
Func _SetPNGIntoPicControl($iPic, $sPNGFile)
    Local Const $STM_SETIMAGE = 0x172
    _GDIPlus_Startup()
    Local $hImage = _GDIPlus_ImageLoadFromFile($sPNGFile)
    Local $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap))
    _WinAPI_DeleteObject($hBitmap)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
EndFunc   ;==>_SetPNGIntoPicControl

unfortunately the native Pic control doesn`t work with PNG files so you should use this function to add PNG images in Pic Controls.

For The pic control look for. GuiCtrlCreatePic() function in the Help File

Link to comment
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
 Share

  • Recently Browsing   0 members

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