Sign in to follow this  
Followers 0
waltzie

How to creare a guy with a background (centered/tiled/stretched)?

4 posts in this topic

#1 ·  Posted (edited)

Hi,

I've done a sample gui with background:

; Create GUI
    
        
    $gui = GUICreate("Background", 200, 200,-1,-1,$WS_TILEDWINDOW)
    GuiCtrlSetState(-1,$GUI_DISABLE)
        $path_background = @ScriptDir & "\myimage.bmp"
        $background = GUICtrlCreatePic($path_background, 0, 0, 0, 0)
    EndIf   
    GuiCtrlSetState(-1,$GUI_ENABLE)

    GUISetState(@SW_SHOW)

; GUI MESSAGE LOOP
    While GuiGetMsg() <> $GUI_EVENT_CLOSE
; wait till gui is closed
    WEnd

How can I:

1. How to know the image source sizes

2. How to know the Top Left pixel colour

3. How to set default background color

4. How to set the image background to be "Tiled" or "streched" or "window centered"?

Thanks for the help

WaltZie

Edited by waltzie

Share this post


Link to post
Share on other sites



I'd suggest you to use GDI+ :)


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

I solved using

$background = GUICtrlCreatePic($path_background, 0, 0, 0, 0)

GUICtrlSetResizing($background,$GUI_DOCKSIZE+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER)

But sill have a problem!

If i add a treeview the visualizzation is bugged!

I can't access to Treeview object, minimizing & maximizing the tree object disappear

here is the example

#Include <GUIConstants.au3>

#include <GuiConstantsEx.au3>

#Include <GuiTreeView.au3>

#include <TreeViewConstants.au3>

#include <WindowsConstants.au3>

#include <StaticConstants.au3>

; Create GUI

$gui = GUICreate("Background", 400, 400,-1,-1,$WS_TILEDWINDOW)

$path_background = @ScriptDir & "\myimage.jpg"

$background = GUICtrlCreatePic($path_background, 0, 0, 0, 0)

GUICtrlSetResizing($background,$GUI_DOCKSIZE+$GUI_DOCKHCENTER+$GUI_DOCKVCENTER); Center the image into window

$maintree = GUICtrlCreateTreeView(10, 10, 120, 150)

$aboutitem = GUICtrlCreateTreeViewItem("About", $maintree)

$miscitem = GUICtrlCreateTreeViewItem("Misc", $aboutitem)

GUISetState(@SW_SHOW)

; GUI MESSAGE LOOP

While GuiGetMsg() <> $GUI_EVENT_CLOSE

; wait till gui is closed

WEnd

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