Code: Select all
img:="D:\2a96558f30074646a6e18da7cb46408c.(960_1200).jpg"
OnMessage(0x0200, func("WM_MOUSEMOVE"))
(gui:=GuiCreate("-Caption")).OnEvent("Close","ExitApp")
gui.BackColor:=0x3f627f
k:=GuiCreate("+E0x80000 0x10000000 +Parent" gui.hwnd)
GdiplusStartup(getvar(pToken:=0),(si:=Struct("UINT GdiplusVersion;PTR DebugEventCallback;BOOL SuppressBackgroundThread;BOOL SuppressExternalCodecs",{GdiplusVersion:1}))[])
GdipCreateBitmapFromFile(&img,getvar(pBitmap:=0))
GdipGetImageDimension(pBitmap, getvar(width:=0), getvar(height:=0))
width:=Cast("Uint",width,"Float")
height:=Cast("Uint",height,"Float")
_W:=width*0.5
_H:=height*0.5
BITMAPINFOHEADER:="DWORD biSize;LONG biWidth;LONG biHeight;WORD biPlanes;WORD biBitCount;DWORD biCompression;DWORD biSizeImage;LONG biXPelsPerMeter;LONG biYPelsPerMeter;DWORD biClrUsed;DWORD biClrImportant;"
bi:=Struct(BITMAPINFOHEADER,{biSize:sizeof(BITMAPINFOHEADER),biWidth:_W,biHeight:_H,biPlanes:1,biBitCount:32})
hbm := CreateDIBSection( hdc:=GetDC(), bi[]),ReleaseDC(0,hdc)
hdc := CreateCompatibleDC(),obm := SelectObject(hdc, hbm)
GdipCreateFromHDC(hdc,getvar(G:=0)),GdipSetInterpolationMode(G, 7)
GdipDrawImageRectRectI(G,pBitmap,0,0,_W,_H,0,0,width,height,2)
pt:=Struct("x,y")
pt.x:=0,pt.y:=0
UpdateLayeredWindow(k.hwnd,0,pt[],getvar(temp1:=_W|_H<<32),hdc, getvar(temp2:=0),0,getvar(temp3:=255<<16|1<<24),2)
gui.show("w" _W " h" _H+50)
Return
WM_MOUSEMOVE(w,l,m,h){
static i:=1
ct(i++ "`t" h "`n")
}
ct(s){
static stdout
Return WriteConsole(stdout?stdout:(AttachConsole(-1),AllocConsole(),stdout:=GetStdHandle(-11)),&s,StrLen(s),0)
}