├── README ├── class ├── Thumbnail.ahk └── examples │ └── demo1.ahk └── lib ├── Thumbnail.ahk └── examples └── demo1.ahk /README: -------------------------------------------------------------------------------- 1 | Thumbnail README: 2 | 3 | This wrapper contains a library and a class that enable you to add Aero Thumbnails to AHK GUIs 4 | and to control them. 5 | 6 | NOTE: The class is the prefered form, library support might be dropped. 7 | 8 | Documentation: http://maul-esel.github.com/AeroThumbnail/lib/docs/Thumbnail (library) 9 | http://maul-esel.github.com/AeroThumbnail/class/docs/Thumbnail (class) -------------------------------------------------------------------------------- /class/Thumbnail.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | class: Thumbnail 3 | wrapped by maul.esel 4 | 5 | Credits: 6 | - skrommel for example how to show a thumbnail (http://www.autohotkey.com/forum/topic34318.html) 7 | - RaptorOne & IsNull for correcting some mistakes in the code 8 | - Lexikos for AutoHotkey_L / AutoHotkey 2 with class syntax 9 | 10 | Requirements: 11 | OS - Windows Vista or Windows 7 (tested on Windows 7) 12 | AutoHotkey - AHK_L v1.1+ / AHK v2 alpha 13 | 14 | Quick-Tutorial: 15 | To add a thumbnail to a gui, you must know the following: 16 | - the hwnd / id of your gui 17 | - the hwnd / id of the window to show 18 | - the coordinates where to show the thumbnail 19 | - the coordinates of the area to be shown 20 | 21 | What to do: 22 | - Create a new Thumbnail instance 23 | - Set its regions with or and , optionally query for the source windows width and height before with or and 24 | - optionally set the opacity with 25 | - show the thumbnail with 26 | */ 27 | class Thumbnail 28 | { 29 | /* 30 | field: module 31 | static field that contains the hModule handle to the loaded dwmapi.dll. 32 | This field is for internal use only. 33 | 34 | See also: 35 | - 36 | */ 37 | static module := DllCall("LoadLibrary", "Str", "dwmapi.dll") 38 | 39 | /* 40 | field: handle 41 | contains the hThumb handle to the thumbnail. 42 | This field is for internal use only. 43 | 44 | See also: 45 | - 46 | */ 47 | handle := 0 48 | 49 | /* 50 | Method: __New 51 | constructor for the class 52 | 53 | Parameters: 54 | HWND hDestination - the handle to the window to display the thumbnail 55 | HWND hSource - the handle to the window to be displayed by the thumbnail 56 | 57 | Returns: 58 | Thumbnail instance - the new Thumbnail instance 59 | */ 60 | __New(hDestination, hSource) 61 | { 62 | VarSetCapacity(thumbnail, 4, 0) 63 | if (DllCall("dwmapi.dll\DwmRegisterThumbnail", "UPtr", hDestination, "UPtr", hSource, "Ptr", &thumbnail) != 0x00) 64 | return false 65 | this.id := NumGet(thumbnail) 66 | } 67 | 68 | /* 69 | Method: __Delete 70 | deconstructor for the class. 71 | */ 72 | __Delete() 73 | { 74 | this.Destroy() 75 | } 76 | 77 | /* 78 | Method: Destroy 79 | destroys a thumbnail relationship and sets the handle to 0 80 | 81 | Returns: 82 | BOOL success - true on success, false on failure 83 | */ 84 | Destroy() 85 | { 86 | id := this.id 87 | this.id := 0 88 | return DllCall("dwmapi.dll\DwmUnregisterThumbnail", "UPtr", id) >= 0x00 89 | } 90 | 91 | /* 92 | Method: GetSourceSize 93 | gets the width and height of the source window 94 | 95 | Parameters: 96 | ByRef INT width - receives the width of the window 97 | ByRef INT height - receives the height of the window 98 | 99 | Returns: 100 | BOOL success - true on success, false on failure 101 | 102 | See also: 103 | - 104 | - 105 | - 106 | */ 107 | GetSourceSize(ByRef width, ByRef height) 108 | { 109 | VarSetCapacity(Size, 8, 0) 110 | if (DllCall("dwmapi.dll\DwmQueryThumbnailSourceSize", "UPtr", this.id, "Ptr", &Size) != 0x00) 111 | return false 112 | width := NumGet(&Size + 0, 0, "int") 113 | height := NumGet(&Size + 0, 4, "int") 114 | return true 115 | } 116 | 117 | /* 118 | Method: GetSourceHeight 119 | gets the height of the source window 120 | 121 | Returns: 122 | INT height - the source window's height 123 | 124 | See also: 125 | - 126 | - 127 | - 128 | */ 129 | GetSourceHeight() 130 | { 131 | this.GetSourceSize(width, height) 132 | return height 133 | } 134 | 135 | /* 136 | Method: GetSourceWidth 137 | gets the width of the source window 138 | 139 | Returns: 140 | INT width - the source window's width 141 | 142 | See also: 143 | - 144 | - 145 | - 146 | */ 147 | GetSourceWidth() 148 | { 149 | this.GetSourceSize(width, height) 150 | return width 151 | } 152 | 153 | /* 154 | Method: Hide 155 | hides a thumbnail. It can be shown again without recreating 156 | 157 | Returns: 158 | BOOL success - true on success, false on failure 159 | 160 | See also: 161 | - 162 | */ 163 | Hide() 164 | { 165 | static dwFlags := 0x00000008, fVisible := false 166 | 167 | VarSetCapacity(dskThumbProps, 45, 0) 168 | 169 | NumPut(dwFlags, dskThumbProps, 0, "UInt") 170 | NumPut(fVisible, dskThumbProps, 37, "UInt") 171 | 172 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 173 | } 174 | 175 | /* 176 | Method: SetDestinationRegion 177 | sets the region to be used for displaying 178 | 179 | Parameters: 180 | INT xDest - the x-coordinate of the rendered thumbnail inside the destination window 181 | INT yDest - the y-coordinate of the rendered thumbnail inside the destination window 182 | INT wDest - the width of the rendered thumbnail inside the destination window 183 | INT hDest - the height of the rendered thumbnail inside the destination window 184 | 185 | Returns: 186 | BOOL success - true on success, false on failure 187 | 188 | See also: 189 | - 190 | - 191 | */ 192 | SetDestinationRegion(xDest, yDest, wDest, hDest) 193 | { 194 | static dwFlags := 0x00000001 195 | 196 | VarSetCapacity(dskThumbProps, 45, 0) 197 | 198 | NumPut(dwFlags, dskThumbProps, 0, "UInt") 199 | NumPut(xDest, dskThumbProps, 4, "Int") 200 | NumPut(yDest, dskThumbProps, 8, "Int") 201 | NumPut(wDest+xDest, dskThumbProps, 12, "Int") 202 | NumPut(hDest+yDest, dskThumbProps, 16, "Int") 203 | 204 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 205 | } 206 | 207 | /* 208 | Method: SetIncludeSourceNC 209 | sets whether the source's non-client area should be included. The default value is true. 210 | 211 | Parameters: 212 | BOOL include - true to include the non-client area, false to exclude it 213 | 214 | Returns: 215 | BOOL success - true on success, false on failure 216 | */ 217 | SetIncludeSourceNC(include) 218 | { 219 | static dwFlags := 0x00000010 220 | 221 | VarSetCapacity(dskThumbProps, 45, 0) 222 | 223 | NumPut(dwFlags, dskThumbProps, 00, "UInt") 224 | NumPut(!include, dskThumbProps, 42, "UInt") 225 | 226 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 227 | } 228 | 229 | /* 230 | Method: SetOpacity 231 | sets the opacity level of the thumbnail 232 | 233 | Returns: 234 | BOOL success - true on success, false on failure 235 | */ 236 | SetOpacity(opacity) 237 | { 238 | static dwFlags := 0x00000004 239 | 240 | VarSetCapacity(dskThumbProps, 45, 0) 241 | 242 | NumPut(dwFlags, dskThumbProps, 0, "UInt") 243 | NumPut(opacity, dskThumbProps, 36, "UChar") 244 | 245 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 246 | } 247 | 248 | /* 249 | Method: SetRegion 250 | sets the regions for both the area to be displayed and the area to be used for displaying 251 | 252 | Parameters: 253 | INT xDest - the x-coordinate of the rendered thumbnail inside the destination window 254 | INT yDest - the y-coordinate of the rendered thumbnail inside the destination window 255 | INT wDest - the width of the rendered thumbnail inside the destination window 256 | INT hDest - the height of the rendered thumbnail inside the destination window 257 | INT xSource - the x-coordinate of the area that will be shown inside the thumbnail 258 | INT ySource - the y-coordinate of the area that will be shown inside the thumbnail 259 | INT wSource - the width of the area that will be shown inside the thumbnail 260 | INT hSource - the height of the area that will be shown inside the thumbnail 261 | 262 | Returns: 263 | BOOL success - true on success, false on failure 264 | 265 | See also: 266 | - 267 | - 268 | */ 269 | SetRegion(xDest, yDest, wDest, hDest, xSource, ySource, wSource, hSource) 270 | { 271 | return this.SetDestinationRegion(xDest, yDest, wDest, hDest) && this.SetSourceRegion(xSource, ySource, wSource, hSource) 272 | } 273 | 274 | /* 275 | Method: SetSourceRegion 276 | sets the region to be displayed 277 | 278 | Parameters: 279 | INT xSource - the x-coordinate of the area that will be shown inside the thumbnail 280 | INT ySource - the y-coordinate of the area that will be shown inside the thumbnail 281 | INT wSource - the width of the area that will be shown inside the thumbnail 282 | INT hSource - the height of the area that will be shown inside the thumbnail 283 | 284 | Returns: 285 | BOOL success - true on success, false on failure 286 | 287 | See also: 288 | - 289 | - 290 | - 291 | - 292 | - 293 | */ 294 | SetSourceRegion(xSource, ySource, wSource, hSource) 295 | { 296 | static dwFlags := 0x00000002 297 | 298 | VarSetCapacity(dskThumbProps, 45, 0) 299 | 300 | NumPut(dwFlags, dskThumbProps, 0, "UInt") 301 | NumPut(xSource, dskThumbProps, 20, "Int") 302 | NumPut(ySource, dskThumbProps, 24, "Int") 303 | NumPut(wSource-xSource, dskThumbProps, 28, "Int") 304 | NumPut(hSource-ySource, dskThumbProps, 32, "Int") 305 | 306 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 307 | } 308 | 309 | /* 310 | Method: Show 311 | shows a previously created and sized thumbnail 312 | 313 | Returns: 314 | BOOL success - true on success, false on failure 315 | 316 | See also: 317 | - 318 | */ 319 | Show() 320 | { 321 | static dwFlags := 0x00000008, fVisible := true 322 | 323 | VarSetCapacity(dskThumbProps, 45, 0) 324 | 325 | NumPut(dwFlags, dskThumbProps, 0, "UInt") 326 | NumPut(fVisible, dskThumbProps, 37, "UInt") 327 | 328 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", "UPtr", this.id, "Ptr", &dskThumbProps) >= 0x00 329 | } 330 | 331 | /* 332 | Method: Unload 333 | unloads the dwmapi-library and sets the module-field to 0 334 | 335 | Returns: 336 | BOOL success - true on success, false on failure 337 | */ 338 | Unload() 339 | { 340 | module := Thumbnail.module 341 | Thumbnail.module := 0 342 | return DllCall("FreeLibrary", "UPtr", module) 343 | } 344 | } -------------------------------------------------------------------------------- /class/examples/demo1.ahk: -------------------------------------------------------------------------------- 1 | #include ..\Thumbnail.ahk 2 | #SingleInstance force 3 | #KeyHistory 0 4 | 5 | OnExit, GuiClose 6 | 7 | WinGet, hSource, ID, A 8 | 9 | Gui +LastFound +AlwaysOnTop 10 | hDest := WinExist() 11 | 12 | thumb := new Thumbnail(hDest, hSource) 13 | 14 | xSource := 0 15 | ySource := 0 16 | wSource := thumb.GetSourceWidth() 17 | hSource := thumb.GetSourceHeight() 18 | xDest := 25 19 | yDest := 25 20 | wDest := 750 21 | hDest := round(hSource / wSource * wDest) 22 | opacity := 255 23 | includeNC := true 24 | 25 | Update() 26 | 27 | thumb.Show() 28 | Gui Show, % "w800 h" hDest + 50 29 | return 30 | 31 | !#1:: 32 | xSource += 50 33 | Update() 34 | return 35 | 36 | !#2:: 37 | ySource += 50 38 | Update() 39 | return 40 | 41 | !#3:: 42 | wSource *= 2 43 | hSource *= 2 44 | Update() 45 | return 46 | 47 | !#4:: 48 | wSource /= 2 49 | hSource /= 2 50 | Update() 51 | return 52 | 53 | !#5:: 54 | opacity -= 25 55 | Update() 56 | return 57 | 58 | !#6:: 59 | includeNC := !includeNC 60 | Update() 61 | return 62 | 63 | !#7::Reload 64 | 65 | GuiClose: 66 | thumb.Destroy() 67 | Thumbnail.Unload() 68 | ExitApp 69 | return 70 | 71 | Update() 72 | { 73 | global 74 | thumb.SetDestinationRegion(xDest, yDest, wDest, hDest) 75 | thumb.SetSourceRegion(xSource, ySource, wSource, hSource) 76 | thumb.SetOpacity(opacity) 77 | thumb.SetIncludeSourceNC(includeNC) 78 | } 79 | -------------------------------------------------------------------------------- /lib/Thumbnail.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | title: Thumbnail library 3 | wrapped by maul.esel 4 | 5 | Credits: 6 | - skrommel for example how to show a thumbnail (http://www.autohotkey.com/forum/topic34318.html) 7 | - RaptorOne & IsNull for correcting some mistakes in the code 8 | 9 | Requirements: 10 | OS - Windows Vista or Windows7 (tested on Windows 7) 11 | AutoHotkey - AHK classic or AHK_L 12 | 13 | To make this work on 64bit you should use AHK_L. 14 | 15 | Quick-Tutorial: 16 | To add a thumbnail to a gui, you must know the following: 17 | - the HWND / id of your gui 18 | - the HWND / id of the window to show 19 | - the coordinates where to show the thumbnail 20 | - the coordinates of the area to be shown 21 | 22 | 1. Create a thumbnail with 23 | 2. Set its regions with , optionally query for the source windows width and height before with . 24 | 3. optionally set the opacity with 25 | 4. show the thumbnail with 26 | */ 27 | 28 | 29 | /* 30 | Function: Thumbnail_Create() 31 | creates a thumbnail relationship between two windows 32 | 33 | Parameters:: 34 | HWND hDestination - the window that will show the thumbnail 35 | HWND hSource - the window whose thumbnail will be shown 36 | 37 | Returns: 38 | HANDLE hThumb - thumbnail id on success, false on failure 39 | 40 | Remarks: 41 | To get the HWNDs, you could use WinExist(). 42 | */ 43 | Thumbnail_Create(hDestination, hSource) 44 | { 45 | _ptr := A_PtrSize ? "UPtr" : "UInt" 46 | 47 | VarSetCapacity(thumbnail, 4, 0) 48 | if DllCall("dwmapi.dll\DwmRegisterThumbnail", _ptr, hDestination, _ptr, hSource, _ptr, &thumbnail) 49 | return false 50 | return NumGet(thumbnail, _ptr) 51 | } 52 | 53 | /* 54 | Function: Thumbnail_SetRegion() 55 | defines dimensions of a previously created thumbnail 56 | 57 | Parameters:: 58 | HANDLE hThumb - the thumbnail id returned by 59 | INT xDest - the x-coordinate of the rendered thumbnail inside the destination window 60 | INT yDest - the y-coordinate of the rendered thumbnail inside the destination window 61 | INT wDest - the width of the rendered thumbnail inside the destination window 62 | INT hDest - the height of the rendered thumbnail inside the destination window 63 | INT xSource - the x-coordinate of the area that will be shown inside the thumbnail 64 | INT ySource - the y-coordinate of the area that will be shown inside the thumbnail 65 | INT wSource - the width of the area that will be shown inside the thumbnail 66 | INT hSource - the height of the area that will be shown inside the thumbnail 67 | 68 | Returns: 69 | BOOL success - true on success, false on failure 70 | */ 71 | Thumbnail_SetRegion(hThumb, xDest, yDest, wDest, hDest, xSource, ySource, wSource, hSource) 72 | { 73 | dwFlags := 0x00000001 | 0x00000002 74 | _ptr := A_PtrSize ? "UPtr" : "UInt" 75 | 76 | VarSetCapacity(dskThumbProps, 45, 0) 77 | 78 | NumPut(dwFlags, dskThumbProps, 00, "UInt") 79 | NumPut(xDest, dskThumbProps, 04, "Int") 80 | NumPut(yDest, dskThumbProps, 08, "Int") 81 | NumPut(wDest+xDest, dskThumbProps, 12, "Int") 82 | NumPut(hDest+yDest, dskThumbProps, 16, "Int") 83 | 84 | NumPut(xSource, dskThumbProps, 20, "Int") 85 | NumPut(ySource, dskThumbProps, 24, "Int") 86 | NumPut(wSource-xSource, dskThumbProps, 28, "Int") 87 | NumPut(hSource-ySource, dskThumbProps, 32, "Int") 88 | 89 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", _ptr, hThumb, _ptr, &dskThumbProps) >= 0x00 90 | } 91 | 92 | 93 | /* 94 | Function: Thumbnail_Show() 95 | shows a previously created and sized thumbnail 96 | 97 | Parameters:: 98 | HANDLE hThumb - the thumbnail id returned by 99 | 100 | Returns: 101 | BOOL success - true on success, false on failure 102 | */ 103 | Thumbnail_Show(hThumb) 104 | { 105 | static dwFlags := 0x00000008, fVisible := 1 106 | _ptr := A_PtrSize ? "UPtr" : "UInt" 107 | 108 | VarSetCapacity(dskThumbProps, 45, 0) 109 | NumPut(dwFlags, dskThumbProps, 00, "UInt") 110 | NumPut(fVisible, dskThumbProps, 37, "Int") 111 | 112 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", _ptr, hThumb, _ptr, &dskThumbProps) >= 0x00 113 | } 114 | 115 | 116 | /* 117 | Function: Thumbnail_Hide() 118 | hides a thumbnail. It can be shown again without recreating 119 | 120 | Parameters:: 121 | HANDLE hThumb - the thumbnail id returned by 122 | 123 | Returns: 124 | BOOL success - true on success, false on failure 125 | */ 126 | Thumbnail_Hide(hThumb) 127 | { 128 | static dwFlags := 0x00000008, fVisible := 0 129 | _ptr := A_PtrSize ? "UPtr" : "UInt" 130 | 131 | VarSetCapacity(dskThumbProps, 45, 0) 132 | 133 | NumPut(dwFlags, dskThumbProps, 00, "Uint") 134 | NumPut(fVisible, dskThumbProps, 37, "Int") 135 | 136 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", _ptr, hThumb, _ptr, &dskThumbProps) >= 0x00 137 | } 138 | 139 | 140 | /* 141 | Function: Thumbnail_Destroy() 142 | destroys a thumbnail relationship 143 | 144 | Parameters:: 145 | HANDLE hThumb - the thumbnail id returned by 146 | 147 | Returns: 148 | BOOL success - true on success, false on failure 149 | */ 150 | Thumbnail_Destroy(hThumb) 151 | { 152 | _ptr := A_PtrSize ? "UPtr" : "UInt" 153 | 154 | return DllCall("dwmapi.dll\DwmUnregisterThumbnail", _ptr, hThumb) >= 0x00 155 | } 156 | 157 | 158 | /* 159 | Function: Thumbnail_GetSourceSize() 160 | gets the width and height of the source window - can be used with 161 | 162 | Parameters:: 163 | HANDLE hThumb - the thumbnail id returned by 164 | ByRef INT width - receives the width of the window 165 | ByRef INT height - receives the height of the window 166 | 167 | Returns: 168 | BOOL success - true on success, false on failure 169 | */ 170 | Thumbnail_GetSourceSize(hThumb, ByRef width, ByRef height) 171 | { 172 | _ptr := A_PtrSize ? "UPtr" : "UInt" 173 | 174 | VarSetCapacity(Size, 8, 0) 175 | if DllCall("dwmapi.dll\DwmQueryThumbnailSourceSize", _ptr, hThumb, _ptr, &Size) 176 | return false 177 | width := NumGet(&Size + 0, 0, "int") 178 | height := NumGet(&Size + 0, 4, "int") 179 | return true 180 | } 181 | 182 | 183 | /* 184 | Function: Thumbnail_SetOpacity() 185 | sets the current opacity level 186 | 187 | Parameters:: 188 | HANDLE hThumb - the thumbnail id returned by 189 | INT opacity - the opacity level from 0 to 255 (will wrap to the other end if invalid) 190 | 191 | Returns: 192 | BOOL success - true on success, false on failure 193 | */ 194 | Thumbnail_SetOpacity(hThumb, opacity) 195 | { 196 | static dwFlags := 0x00000004 197 | _ptr := A_PtrSize ? "UPtr" : "UInt" 198 | 199 | VarSetCapacity(dskThumbProps, 45, 0) 200 | 201 | NumPut(dwFlags, dskThumbProps, 00, "UInt") 202 | NumPut(opacity, dskThumbProps, 36, "UChar") 203 | 204 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", _ptr, hThumb, _ptr, &dskThumbProps) >= 0x00 205 | } 206 | 207 | /* 208 | Function: Thumbnail_SetIncludeNC() 209 | sets whether the source's non-client area should be included. The default value is true. 210 | 211 | Parameters: 212 | HANDLE hThumb - the thumbnail id returned by 213 | BOOL include - true to include the non-client area, false to exclude it 214 | 215 | Returns: 216 | BOOL success - true on success, false on failure 217 | */ 218 | Thumbnail_SetIncludeNC(hThumb, include) 219 | { 220 | static dwFlags := 0x00000010 221 | _ptr := A_PtrSize ? "UPtr" : "UInt" 222 | 223 | VarSetCapacity(dskThumbProps, 45, 0) 224 | 225 | NumPut(dwFlags, dskThumbProps, 00, "UInt") 226 | NumPut(!include, dskThumbProps, 42, "UInt") 227 | 228 | return DllCall("dwmapi.dll\DwmUpdateThumbnailProperties", _ptr, hThumb, _ptr, &dskThumbProps) >= 0x00 229 | } -------------------------------------------------------------------------------- /lib/examples/demo1.ahk: -------------------------------------------------------------------------------- 1 | #SingleInstance force 2 | #NoEnv 3 | #KeyHistory 0 4 | #Include ..\Thumbnail.ahk 5 | 6 | SetWorkingDir %A_ScriptDir% 7 | OnExit, GuiClose 8 | 9 | WinGet, hSource, ID, A 10 | 11 | Gui +LastFound +AlwaysOnTop 12 | hDest := WinExist() 13 | 14 | thumb := Thumbnail_Create(hDest, hSource) 15 | 16 | xSource := 0 17 | ySource := 0 18 | Thumbnail_GetSourceSize(thumb, wSource, hSource) 19 | xDest := 25 20 | yDest := 25 21 | wDest := 750 22 | hDest := round(hSource / wSource * wDest) 23 | opacity := 255 24 | includeNC := true 25 | 26 | Thumbnail_SetRegion(thumb, xDest, yDest, wDest, hDest, xSource, ySource, wSource, hSource) 27 | Thumbnail_Show(thumb) 28 | Gui, Show, % "w800 h" hDest + 50 29 | return 30 | 31 | !#1:: 32 | xSource += 50 33 | Thumbnail_SetRegion(thumb, xDest, yDest, wDest, hDest, xSource, ySource, wSource, hSource) 34 | return 35 | 36 | !#2:: 37 | ySource += 50 38 | Thumbnail_SetRegion(thumb, xDest, yDest, wDest, hDest, xSource, ySource, wSource, hSource) 39 | return 40 | 41 | !#3:: 42 | wSource *= 2 43 | hSource *= 2 44 | Thumbnail_SetRegion(thumb, xDest, yDest, wDest, hDest, 0, 0, wSource, hSource) 45 | return 46 | 47 | !#4:: 48 | wSource /= 2 49 | hSource /= 2 50 | Thumbnail_SetRegion(thumb, xDest, yDest, wDest, hDest, 0, 0, wSource, hSource) 51 | return 52 | 53 | !#5:: 54 | opacity-=25 55 | Thumbnail_SetOpacity(thumb, opacity) 56 | return 57 | 58 | !#6:: 59 | Thumbnail_SetIncludeNC(thumb, includeNC := !includeNC) 60 | return 61 | 62 | !#7::Reload 63 | 64 | GuiClose: 65 | Thumbnail_Destroy(thumb) 66 | ExitApp 67 | return --------------------------------------------------------------------------------