AutoHotkey Community

It is currently May 27th, 2012, 8:21 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: January 27th, 2012, 9:54 am 
Offline

Joined: February 29th, 2008, 12:11 pm
Posts: 943
The documentation on GUI Pic says:
Quote:
To use a picture as a background for other controls, the picture should normally be added prior to those controls.


I added a pic before all the controls in my window, but the picture us added not as a background:

Code:
Gui, New
Gui, Add, Picture,  ,pf.jpg
Gui, Add, Button, section  , spiritual
Gui, Add, Button, , Oliver
Gui, Add, Button, , Internet
Gui, Add, Button, , Papal
Gui, Add, Button, ys , organizer
Gui, Add, Button, , Chris
Gui, Add, Button, , GMail
Gui, Add, Button, , Cheryl
Gui, Add, Button, ys , translit
Gui, Add, Button, , Resump
Gui, Add, Button, , AHK
Gui, Add, Button, , Calc
Gui, Show, ,my main


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2012, 10:14 am 
Use BackgroundTrans.
Code:
Gui, New
Gui, Add, Picture, w200 h150 BackgroundTrans, C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg
Gui, Add, Button, xp+20 yp+50 w150 h50, Button
Gui, Show, ,my main


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2012, 10:22 am 
Offline

Joined: February 29th, 2008, 12:11 pm
Posts: 943
Thank you. Is there any way to make that background picture automatically spread to the borders of the window?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2012, 10:53 am 
Code:
Gui, New, +hwndHwndGui

; Compose Gui controls
Gui, Add, Button, section , spiritual
Gui, Add, Button, , Oliver
Gui, Add, Button, , Internet
Gui, Add, Button, , Papal
Gui, Add, Button, ys , organizer
Gui, Add, Button, , Chris
Gui, Add, Button, , GMail
Gui, Add, Button, , Cheryl
Gui, Add, Button, ys , translit
Gui, Add, Button, , Resump
Gui, Add, Button, , AHK
Gui, Add, Button, , Calc

; Show the Gui, but make it invisible to retrieve the dimensions
Gui, Show, Hide
DetectHiddenWIndows, On   ;necessary
WinGetPos,,, GuiWidth, GuiHeight, ahk_id %hWndGui%
WinGet, ControlListHwnd , ControlListHwnd, ahk_id %hWndGui%

; Add the picture with the retrieved dimensions.
Gui, Add, Picture, x0 y0 w%GuiWidth% h%GuiHeight% hwndhWndPicControl, C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg

; Show Gui
Gui, Show,,my main

; Redraw only works when the window is visible
Loop, Parse, ControlListHwnd, `n
   WinSet, Redraw,, ahk_id %A_LoopField%


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2012, 11:49 am 
Offline

Joined: February 29th, 2008, 12:11 pm
Posts: 943
WOW!!! Thank you for your time!!!!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, hyper_, immunity, migz99, sjc1000 and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group