Ed_Maximized Posted October 27, 2006 Share Posted October 27, 2006 (edited) This litte script creates a form and sets a gif image tiled in background...I put an example gif but any works ok!!!This is:expandcollapse popup#include <GUIConstants.au3> $gif=FileOpenDialog("Select a GIF file",@ScriptDir,"GIF files (*.gif)") $tiles = _GUICreateWithTiledBackground($gif, 640, 400) GUICtrlCreateLabel("Test Label:", 48, 72, 57, 17) $Input1 = GUICtrlCreateInput("", 112, 72, 137, 21, -1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Test Button", 432, 312, 105, 33) GUISetState(@SW_SHOW,$tiles) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _GUICreateWithTiledBackground($sPic, $guiW, $guiH) ;$sPic MUST be Gif $GuiWH=GUICreate("Tiles Example", $guiW, $guiH) Local $tileW,$tileH _GetGifPixWidth_Height($sPic, $tileW, $tileH) Local $iTilesX = Round($guiW / $tileW) Local $iTilesY = Round($guiH / $tileH) ConsoleWrite($iTilesX&","&$iTilesY) Local $x = 0, $y = 0 For $i = 0 To $iTilesX For $ii = 0 To $iTilesY GUICtrlCreatePic($sPic, $i*$tileW, $ii*$tileH, $tileW, $tileH) GUICtrlSetState(-1, $GUI_DISABLE) Next Next Return $GuiWH EndFunc ;==>_GUICreateWithTiledBackground Func _GetGifPixWidth_Height($s_gif, ByRef $pwidth, ByRef $pheight) ;Thanks to gafrost If FileGetSize($s_gif) > 9 Then Local $sizes = FileRead($s_gif, 10) ConsoleWrite("Gif version: " & StringMid($sizes,1,6) & @LF) $pwidth = Asc(StringMid($sizes, 8, 1)) * 256 + Asc(StringMid($sizes, 7, 1)) $pheight = Asc(StringMid($sizes, 10, 1)) * 256 + Asc(StringMid($sizes, 9, 1)) ConsoleWrite($pwidth & " x " & $pheight & @LF) EndIf EndFunc ;==>_GetGifPixWidth_HeightHasta la vista!Some code is from others... I just take the pieces together... Special thanks to jpam and razermEd Edited October 30, 2006 by Ed_Maximized ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
_Kurt Posted October 27, 2006 Share Posted October 27, 2006 Lovin' your work, Ed. This could make programs look more professional and create better effects. Another great script by Ed Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 27, 2006 Share Posted October 27, 2006 Usually a good idea to put the Header with the function from other peoples scripts SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Ed_Maximized Posted October 28, 2006 Author Share Posted October 28, 2006 Usually a good idea to put the Header with the function from other peoples scripts@gafrost: Sorry!!! :"> I've used your function so many times... this is the first time I don´t give you the credits!!! Corrected ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now