Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance,force
- #HotkeyInterval 2000 ; This is the default value (milliseconds).
- #MaxHotkeysPerInterval 2000
- #Include, <Gdip>
- SetBatchLines,-1
- ptoken:=Gdip_Startup()
- counter:=90
- width:=450
- height:=450
- Gui, -Caption +LastFound +E0x80000 -DPIScale
- Gui,Show,x10 y10 w%width% h%Height%,something
- hwnd1:= WinExist()
- hbm := CreateDIBSection(Width, Height)
- hdc := CreateCompatibleDC()
- obm := SelectObject(hdc, hbm)
- G := Gdip_GraphicsFromHDC(hdc)
- Gdip_SetSmoothingMode(G, 4)
- pBrush1 := Gdip_BrushCreateSolid("0xffffffff")
- pBrush2 := Gdip_BrushCreateSolid("0xFF000000")
- ;get a bitmap of a specified window
- SetWorkingDir,C:\Users\Admin\Desktop\gdip_roasted
- pBitmapWin1 := Gdip_CreateBitmapFromFile("weat.png")
- pBitmapWin2 := Gdip_CreateBitmapFromFile("back.png")
- pBitmapWin3 := Gdip_CreateBitmapFromFile("car.png")
- pBitmapWin4 := Gdip_CreateBitmapFromFile("flower.png")
- UpdateLayeredWindow(hwnd1, hdc, 200, 100, Width, Height)
- Gdip_FillRectangle(g, pBrush2, 0, 0,Width, Height)
- SoundBeep
- UpdateLayeredWindow(hwnd1, hdc, 200, 100, Width, Height)
- SetTimer,Game_Loop,1
- return
- game_loop:
- ;~ SoundBeep,,1500
- Gdip_FillRectangle(g, pBrush2, 0, 0,Width, Height)
- gosub draw
- UpdateLayeredWindow(hwnd1, hdc)
- return
- draw:
- turn_in_graphics( g,width/3,height/3,counter,pBitmapWin1)
- turn_in_graphics( g,width/3,2*height/3,counter,pBitmapWin2)
- turn_in_graphics( g,2*width/3,2*height/3,counter,pBitmapWin3)
- turn_in_graphics( g,2*width/3,height/3,counter,pBitmapWin4)
- ;~ draw:
- ;~ Gdip_GetRotatedDimensions(250, 250, counter, RWidth, RHeight)
- ;~ MsgBox,% "Rwidth: " RWidth "`nrheight: " rheight
- ;~ ; xTranslation and yTranslation now contain the distance to shift the image by
- ;~ Gdip_GetRotatedTranslation(250, 250, counter, xTranslation, yTranslation)
- ;~ MsgBox,% "xTranslation: " xTranslation "`nyTranslation: " yTranslation
- ;~ pBitmap := Gdip_CreateBitmap(RWidth, RHeight) ; Create a new bitmap
- ;~ Gg := Gdip_GraphicsFromImage(pBitmap) ; Get a pointer to the graphics of the bitmap
- ;~ Gdip_SetSmoothingMode(Gg, 4)
- ;~ ; Best interpolation is 5 - it's like no antialias
- ;~ Gdip_SetInterpolationMode(Gg, 7)
- ;~ Gdip_TranslateWorldTransform(Gg, xTranslation, yTranslation)
- ;~ Gdip_RotateWorldTransform(Gg, counter)
- ;~ Gdip_DrawImage(Gg, pBitmapWin, 0,0, 250, 250 ) ; Draw the original image onto the new bitmap
- ;~ Gdip_ResetWorldTransform(Gg)
- ;~ Gdip_DrawImage(G, pBitmap, 250-RWidth/2, 250-rheight/2, RWidth, RHeight)
- return
- ;#Include,C:\Users\Admin\Desktop\gdip_roasted\turnbitmapandreturn.ahk
- x::
- Gdip_Shutdown(pToken)
- ExitApp
- a::
- counter-=5
- counter:=mod(counter,360)
- return
- d::
- counter+=5
- counter:=mod(counter,360)
- return
- ;~ xbitmap
- turn_bitmap(byref xbitmap,xturn){
- xWidth := Gdip_GetImageWidth(xbitmap)
- xHeight := Gdip_GetImageHeight(xbitmap)
- Gdip_GetRotatedDimensions(xWidth, xHeight, xturn, xRWidth, xRHeight)
- ;~ MsgBox,% "Rwidth: " RWidth "`nrheight: " rheight
- ; xTranslation and yTranslation now contain the distance to shift the image by
- Gdip_GetRotatedTranslation(xWidth, xHeight, xturn, xxTranslation, xyTranslation)
- ;~ MsgBox,% "xTranslation: " xTranslation "`nyTranslation: " yTranslation
- xpBitmap := Gdip_CreateBitmap(xRWidth, xRHeight) ; Create a new bitmap
- xg := Gdip_GraphicsFromImage(xpBitmap) ; Get a pointer to the graphics of the bitmap
- Gdip_SetSmoothingMode(xg, 4)
- ; Best interpolation is 5 - it's like no antialias
- Gdip_SetInterpolationMode(xg, 7)
- Gdip_TranslateWorldTransform(xg, xxTranslation, xyTranslation)
- Gdip_RotateWorldTransform(xg, xturn)
- Gdip_DrawImage(xg, xbitmap, 0,0, xWidth, xHeight) ; Draw the original image onto the new bitmap
- Gdip_ResetWorldTransform(xg)
- ;~ Gdip_DisposeImage(xBitmap)
- ;~ xBitmap := Gdip_CreateBitmap(xRWidth, xRHeight) ; Create a new bitmap
- ;~ xg0 := Gdip_GraphicsFromImage(xBitmap)
- ;~ Gdip_DrawImage(xg0, xpBitmap, 0,0, xrWidth, xrHeight)
- ;~ SetWorkingDir,C:\Users\Admin\Desktop\gdip_roasted\newque
- ;~ if(xturn = 120){
- ;~ SoundBeep,,1400
- ;~ Gdip_SaveBitmapToFile(xpBitmap, "me120.png")
- ;~ }
- ;~ SetWorkingDir,C:\Users\Admin\Desktop\gdip_roasted
- xbitmap:=xpbitmap
- }
- ;~ Gdip_DrawImage(G, pBitmap, 250-RWidth/2, 250-rheight/2, 3000, 3000, 0, 0, 3000, 3000)
- turn_in_graphics(byref xg,xx,xy,xturn,xbitmap){
- ToolTip,% xturn
- turn_bitmap(xbitmap,xturn)
- xWidth := Gdip_GetImageWidth(xbitmap)
- xHeight := Gdip_GetImageHeight(xbitmap)
- Gdip_DrawImage(xG, xBitmap, xx-xWidth/2, xy-xheight/2, xWidth, xHeight)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement