认认真真的敲了一遍,加深理解!
#include Gdip_All.ahk

if !pToken:=Gdip_Startup()
{
MsgBox,48,GDI+错误!,GDI+启动错误。
ExitApp
}
OnExit,GdipExit
Gui,1: -caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs

Gui,1:show,NA
hWnd1:=WinExist()
Loop,files,%A_WinDir%webwallpaper*.jpg,R
ImgPath:=A_LoopFileLongPath
pBitmap:=Gdip_CreateBitmapFromFile(ImgPath)
If !pBitmap
{
MsgBox,48,文件加载错误!
ExitApp
}

PicWidth:=Gdip_GetImageWidth(pBitmap)
PicHeight:=Gdip_GetImageHeight(pBitmap)

DisplayAreaWidth:=A_ScreenWidth
DisplayAreaHeight:=A_ScreenHeight
hbm:=CreateDIBSection(DisplayAreaWidth,DisplayAreaHeight)
hdc:=CreateCompatibleDC()
obm:=SelectObject(hdc,hbm)
G:=Gdip_GraphicsFromHDC(hdc)
Gdip_SetInterpolationMode(G,7)
Gdip_DrawImage(G,pBitmap,0,0,DisplayAreaWidth//3,DisplayAreaHeight//3,0,0,PicWidth,PicHeight)
Gdip_DrawImage(G,pBitmap,800,0,DisplayAreaWidth//3,DisplayAreaHeight//3,0,0,PicWidth,PicHeight)
Gdip_DrawImage(G,pBitmap,0,500,DisplayAreaWidth//3,DisplayAreaHeight//3,0,0,PicWidth,PicHeight)
UpdateLayeredWindow(hwnd1,hdc,200,0,DisplayAreaWidth,DisplayAreaHeight)
Sleep,2000
UpdateLayeredWindow(hwnd1,hdc,200,0,DisplayAreaWidth//2,DisplayAreaHeight//2)
Gdip_DisposeImage(pBitmap)
Gdip_DeleteGraphics(G)
SelectObject(hdc,obm)
DeleteDC(hdc)
DeleteObject(hbm)
Return
GuiClose:
GuiEscape:
GdipExit:
Gdip_Shutdown(pToken)
ExitApp
Return