Advertisement
Guest User

2048 (AutoHotkey Game)

a guest
May 17th, 2018
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Written By: Hellbent
  3.     Youtube: https://www.youtube.com/user/CivReborn
  4.     Date Started: May 15th, 2018
  5.     Date Of Last Edit: May 17th, 2018
  6.     Last PasteBin Save: https://pastebin.com/WdQ0UWY0
  7.     Description:
  8.         Recreation of the game 2048.
  9.         Use arrow keys to move tiles around. Goal: Slide tiles of the same value together to form new tiles of a higher value.
  10.         Game ends when there is no free spaces/moves.
  11. */
  12. #SingleInstance,Force
  13. IfNotExist,%A_ScriptDir%/2048 Assets
  14.     Create_Game_Assets()
  15. SetWorkingDir,%A_ScriptDir%/2048 Assets
  16. global row_col_Positions:={1:36,2:121,3:206,4:291},WB,score_x:=400,Grid_Array:=[],Tiles:={},Can_Move:=1,Value_Array:=[],Game_Active:=0,High_Scores:="" ,My_Score:=0,Scores:=[],Names:=[]
  17. FileRead,temp_score,Scores.txt
  18. Loop, Parse,temp_Score,*
  19.     Scores[A_Index]:=A_LoopField
  20. i:=1
  21. Loop 3
  22.     {
  23.         tempp:=StrSplit(Scores[A_Index]," ")
  24.         Loop,% tempp.Length()-1
  25.             Names[i].=tempp[A_Index]
  26.         Scores[A_Index]:=tempp[tempp.MaxIndex()],i++
  27.     }
  28. game:=New Game_Board()
  29. return
  30. GuiClose:
  31. GuiEscape:
  32. *^ESC::
  33.     ExitApp
  34. Move_Window:
  35.     PostMessage,0xA1,2
  36.     return
  37. Min_Window:
  38.     Gui,1:Minimize
  39.     return
  40. Tag:
  41.     Try {
  42.      Run,https://www.youtube.com/user/CivReborn
  43.     }
  44.     return
  45. New_Game:
  46.     My_Score:=0,Game_Active:=1
  47.     GuiControl,1:,My_Score,% My_Score
  48.     Remove_Bot()
  49.     game.Build_Grid()
  50.     Loop 2
  51.         Tiles[Tiles.Length()+1]:=New Game_Tile()
  52.     return
  53. Score_Scroll:
  54.     if(score_x<0-posw)
  55.         score_x:=396
  56.     score_x--
  57.     GuiControl,3:Move,ss,x%Score_X%
  58.     return
  59. #IfWinActive, 2048
  60. ~up::
  61.     if(!Key_Pressed)
  62.         {
  63.             key_Pressed:=1
  64.             SetTimer,Score_Scroll,Off
  65.             Move_Tiles(3,4,2,1,1,1,-1,0,-1,0,1)
  66.             Check_Game_State()
  67.             SetTimer,Score_Scroll,On
  68.             While(GetKeyState("Up"))
  69.                 sleep,10
  70.             key_Pressed:=0
  71.         }
  72.     return
  73. ~Down::
  74.     if(!Key_Pressed)
  75.         {
  76.             key_Pressed:=1
  77.             SetTimer,Score_Scroll,Off
  78.             Move_Tiles(3,4,3,1,-1,1,1,0,1,0,3)
  79.             Check_Game_State()
  80.             SetTimer,Score_Scroll,On
  81.             While(GetKeyState("Down"))
  82.                 sleep,10
  83.             key_Pressed:=0
  84.         }
  85.     return
  86. ~Left::
  87.     if(!Key_Pressed)
  88.         {
  89.             key_Pressed:=1
  90.             SetTimer,Score_Scroll,Off
  91.             Move_Tiles(4,3,1,2,1,1,0,-1,0,-1,4)
  92.             Check_Game_State()
  93.             SetTimer,Score_Scroll,On
  94.             While(GetKeyState("Left"))
  95.                 sleep,10
  96.             key_Pressed:=0
  97.         }
  98.     return
  99. ~Right::
  100.     if(!Key_Pressed)
  101.         {
  102.             key_Pressed:=1
  103.             SetTimer,Score_Scroll,Off
  104.             Move_Tiles(4,3,1,3,1,-1,0,1,0,1,2)
  105.             Check_Game_State()
  106.             SetTimer,Score_Scroll,On
  107.             While(GetKeyState("Right"))
  108.                 sleep,10
  109.             key_Pressed:=0
  110.         }
  111.     return
  112.  
  113. #If
  114. Check_Game_State()
  115.     {
  116.         if(Game_Active=1)
  117.             {
  118.                 i:=1
  119.                 loop 4
  120.                     {
  121.                         j:=1
  122.                         Loop 4
  123.                             {
  124.                                 if(Grid_Array[i,j]=0)
  125.                                     return
  126.                                 j++
  127.                             }
  128.                         i++
  129.                     }
  130.                 k:=1
  131.                 Loop,% Tiles.Length()
  132.                     {
  133.                         i:=1   
  134.                         Loop, 4
  135.                             {
  136.                                 j:=1
  137.                                 Loop, 4
  138.                                     {
  139.                                         if(Tiles[k].Y=i&&Tiles[k].X=j)
  140.                                             {
  141.                                                 Value_Array[i,j]:=Tiles[k].Value
  142.                                             }
  143.                                         j++
  144.                                     }
  145.                                 i++
  146.                             }
  147.                         k++
  148.                     }
  149.                 i:=1   
  150.                 Loop 4 
  151.                     {
  152.                         j:=1
  153.                         Loop 4
  154.                             {
  155.                                 if(Value_Array[i,j]=Value_Array[i-1,j]||Value_Array[i,j]=Value_Array[i+1,j]||Value_Array[i,j]=Value_Array[i,j-1]||Value_Array[i,j]=Value_Array[i,j+1])
  156.                                     {
  157.                                         return
  158.                                     }
  159.                                 j++
  160.                             }
  161.                         i++
  162.                     }
  163.                 Game_Over()
  164.             }      
  165.     }
  166. Game_Over()
  167.     {
  168.         Game_Active:=0,New_Score:=0
  169.         Remove_Bot()
  170.         loop 3
  171.             {
  172.                 if(My_Score>Scores[A_Index])
  173.                     {
  174.                         Gui,1:+OwnDialogs
  175.                         InputBox,name,New High Score,Enter Your Name
  176.                         New_Score:=1
  177.                         break
  178.                     }
  179.             }
  180.         if(New_Score=1)
  181.             {
  182.                 if(My_Score>Scores[1])
  183.                     Scores[3]:=Scores[2],Names[3]:=Names[2],Scores[2]:=Scores[1],Names[2]:=Names[1],Scores[1]:=My_Score,Names[1]:=Name
  184.                 else if(My_Score>Scores[2])
  185.                     Scores[3]:=Scores[2],Names[3]:=Names[2],Scores[2]:=My_Score,Names[2]:=Name
  186.                 else if(My_Score>Scores[3])
  187.                     Scores[3]:=My_Score,Names[3]:=Name
  188.                 FileSetAttrib, -RH,scores.txt
  189.                 FileDelete,%A_ScriptDir%/2048 Assets/scores.txt
  190.                 FileAppend,% Names[1] " " Scores[1] "*" Names[2] " " Scores[2] "*" Names[3] " " Scores[3] "*",%A_ScriptDir%/2048 Assets/scores.txt
  191.                 FileSetAttrib, +RH,%A_ScriptDir%/2048 Assets/scores.txt        
  192.                 GuiControl,3:,ss,% "1: " Names[1] " " Scores[1] "          2: " Names[2] " " Scores[2] "          3: " Names[3] " " Scores[3] "          "
  193.             }
  194.         else
  195.             {
  196.                 Gui,1:+OwnDialogs
  197.                 MsgBox,Game Over
  198.             }
  199.     }
  200. Merge(new_pos,old_pos)
  201.     {
  202.         global
  203.         Tiles[new_Pos].Value *= 2,My_Score+=Tiles[new_Pos].Value
  204.         GuiControl,1:,My_Score,% My_Score
  205.         Tiles[new_Pos].Has_Merged:=1,Grid_Array[Tiles[old_pos].Y,Tiles[old_pos].X]:=0,img:=Tiles[old_pos].img
  206.         img.ParentNode.RemoveChild(img)
  207.         Tiles.RemoveAt(old_pos)
  208.         Loop,% Tiles.Length()
  209.             Tiles[A_Index].img.src:=A_WorkingDir "\" Tiles[A_Index].Value ".png"
  210.     }
  211. Remove_Bot()
  212.     {
  213.         n:=Tiles.Length()
  214.         Loop, % Tiles.length()+1
  215.             {
  216.                 img:=Tiles[n].img
  217.                 img.ParentNode.RemoveChild(img)
  218.                 Tiles.RemoveAt(n)
  219.                 n--
  220.             }  
  221.     }
  222. Move_Tiles(i_Loop,j_Loop,i_Start,j_Start,i_Count,j_Count,i_Array,j_Array,y_Add,x_Add,Dir)
  223.     {
  224.         if(Can_Move=1)
  225.         {
  226.             Something_Moved:=0
  227.             Can_Move:=0
  228.             Loop, % Tiles.Length()
  229.                 Tiles[A_Index].Has_Merged:=0
  230.             redo:      
  231.             i:=i_Start
  232.             Loop % i_Loop
  233.                 {
  234.                     j:=j_Start
  235.                     Loop % j_Loop
  236.                         {
  237.                             Loop,% Tiles.Length()
  238.                                 {
  239.                                     if(Tiles[A_Index].Y=i&&Tiles[A_Index].X=j)
  240.                                         {
  241.                                             if(Grid_Array[i+i_Array,j+j_Array]=0)
  242.                                                 Tiles[A_Index].Is_Moving:=1,Tiles[A_Index].X+=x_Add,Tiles[A_Index].Y+=y_Add,Grid_Array[i+i_Array,j+j_Array]:=1,Grid_Array[i,j]:=0,Something_Moved:=1
  243.                                             else if(Grid_Array[i+i_Array,j+j_Array]=1&&Tiles[A_Index].Is_Moving=0)
  244.                                                 {
  245.                                                     k:=A_Index
  246.                                                     Loop,% Tiles.Length()
  247.                                                         {
  248.                                                             if(Tiles[A_Index].Y=i+i_Array&&Tiles[A_Index].X=j+j_Array&&Tiles[A_Index].Is_Moving=0&&Tiles[A_Index].Value=Tiles[k].Value&&Tiles[A_index].Has_Merged=0&&Tiles[k].Has_Merged=0)
  249.                                                                 {
  250.                                                                     Merge(A_Index,k)
  251.                                                                     Something_Moved:=1
  252.                                                                 }
  253.                                                         }
  254.                                                 }
  255.                                         }
  256.                                 }
  257.                             j+=j_Count 
  258.                         }
  259.                     i+=i_Count 
  260.                    
  261.                 }
  262.         m:=0
  263.         Loop,% Tiles.Length()
  264.             {
  265.                 if(Tiles[A_Index].Is_Moving=1)
  266.                         m++
  267.             }
  268.         if(m>0)
  269.             {
  270.                 Loop 17
  271.                     {
  272.                         Loop, % Tiles.Length()
  273.                             {
  274.                                 if(Dir=1)
  275.                                     {
  276.                                         if(Tiles[A_Index].Is_Moving=1&&Tiles[A_Index].ry>row_col_Positions[Tiles[A_Index].Y])
  277.                                             Tiles[A_Index].ry-=5,Style:=Tiles[A_Index].img.Style,Style.Top:=Tiles[A_Index].ry
  278.                                         else if(Tiles[A_Index].Is_Moving:=1&&Tiles[A_Index].ry<=row_col_Positions[Tiles[A_Index].Y])
  279.                                             Tiles[A_Index].Is_Moving:=0,Tiles[A_Index].ry:=row_col_Positions[Tiles[A_Index].Y],Style:=Tiles[A_Index].img.Style,Style.Top:=Tiles[A_Index].ry
  280.                                     }
  281.                                 else if(Dir=2)
  282.                                     {
  283.                                         if(Tiles[A_Index].Is_Moving=1&&Tiles[A_Index].rx>row_col_Positions[Tiles[A_Index].X])
  284.                                             Tiles[A_Index].rx+=5,Style:=Tiles[A_Index].img.Style,Style.Left:=Tiles[A_Index].rx
  285.                                         else if(Tiles[A_Index].Is_Moving:=1&&Tiles[A_Index].rx<=row_col_Positions[Tiles[A_Index].X])
  286.                                             Tiles[A_Index].Is_Moving:=0,Tiles[A_Index].rx:=row_col_Positions[Tiles[A_Index].X],Style:=Tiles[A_Index].img.Style,Style.Left:=Tiles[A_Index].rx
  287.                                         else
  288.                                             Tiles[A_Index].Is_Moving:=0
  289.                                     }
  290.                                 else if(Dir=3)
  291.                                     {
  292.                                         if(Tiles[A_Index].Is_Moving=1&&Tiles[A_Index].ry<row_col_Positions[Tiles[A_Index].Y])
  293.                                             Tiles[A_Index].ry+=15,Style:=Tiles[A_Index].img.Style,Style.Top:=Tiles[A_Index].ry
  294.                                         else if(Tiles[A_Index].Is_Moving:=1&&Tiles[A_Index].ry>=row_col_Positions[Tiles[A_Index].Y])
  295.                                             Tiles[A_Index].Is_Moving:=0,Tiles[A_Index].ry:=row_col_Positions[Tiles[A_Index].Y],Style:=Tiles[A_Index].img.Style,Style.Top:=Tiles[A_Index].ry
  296.                                         else
  297.                                             Tiles[A_Index].Is_Moving:=0
  298.                                     }
  299.                                 else if(Dir=4)
  300.                                     {
  301.                                         if(Tiles[A_Index].Is_Moving=1&&Tiles[A_Index].rx>row_col_Positions[Tiles[A_Index].X])
  302.                                             Tiles[A_Index].rx-=5,Style:=Tiles[A_Index].img.Style,Style.Left:=Tiles[A_Index].rx
  303.                                         else if(Tiles[A_Index].Is_Moving:=1&&Tiles[A_Index].rx<=row_col_Positions[Tiles[A_Index].X])
  304.                                             Tiles[A_Index].Is_Moving:=0,Tiles[A_Index].rx:=row_col_Positions[Tiles[A_Index].X],Style:=Tiles[A_Index].img.Style,Style.Left:=Tiles[A_Index].rx
  305.                                         else
  306.                                             Tiles[A_Index].Is_Moving:=0
  307.                                     }
  308.                                
  309.                             }
  310.                            
  311.                     }
  312.                 goto, redo
  313.             }
  314.            
  315.             While(GetKeyState("Down"))
  316.                     Sleep,10
  317.             Can_Move:=1    
  318.             if(Something_Moved=1)
  319.                 Tiles[Tiles.Length()+1]:=New Game_Tile()
  320.         }
  321.     }
  322.    
  323. Class Game_Tile
  324.     {
  325.         __New()
  326.             {
  327.                 i:=1,free:=0
  328.                 Loop 4
  329.                     {
  330.                         j:=1
  331.                         Loop 4
  332.                             {
  333.                                 if(Grid_Array[i,j]=0)
  334.                                     {
  335.                                         free:=1
  336.                                         break
  337.                                     }
  338.                                 j++
  339.                             }
  340.                         i++
  341.                     }
  342.                 if(!free)
  343.                     {
  344.                         MsgBox, 262144, ,Game Over
  345.                         game:=New Game_Board()
  346.                     }
  347.                 else
  348.                     {
  349.                         Loop
  350.                             {
  351.                                 Random,tx,1,4
  352.                                 Random,ty,1,4
  353.                                 Random,value,1,10
  354.                                 if(value<7)
  355.                                     This.Value:=2
  356.                                 else
  357.                                     This.Value:=4
  358.                                 if(Grid_Array[ty,tx]=0)
  359.                                     {
  360.                                         This.X:=tx,This.Y:=ty,Grid_Array[ty,tx]:=1
  361.                                         break
  362.                                     }
  363.                             }
  364.                         This.Has_Merged:=0,This.Is_Moving:=0
  365.                         This.Draw_Tile()
  366.                     }
  367.             }
  368.         Draw_Tile()
  369.             {
  370.                
  371.                 tx:=row_col_Positions[This.X],ty:=row_col_Positions[This.Y],This.rx:=tx,This.ry:=ty
  372.                 img:=WB.CreateElement("img"),This.img:=img,img.src:=A_WorkingDir "\" This.Value ".png",Style:=img.Style
  373.                 for a,b in {Left:tx,top:ty,position:"absolute",width:75,height:75}
  374.                 Style[a]:=b
  375.                 WB.Body.AppendChild(This.img)
  376.             }
  377.        
  378.     }
  379.  
  380. Class Game_Board
  381.     {
  382.         __New()
  383.             {
  384.                 global
  385.                 Remove_Bot()
  386.                 score_x:=396,Can_Move:=1,Game_Active:=1
  387.                 Gui,1:Destroy
  388.                 Gui,1:+AlwaysOnTop -Caption Border -DPIScale
  389.                 Gui,1:Color,111111
  390.                 Gui,1:Add,Picture,x8 y8 w30 h30 gTag,Tag.png
  391.                 Gui,1:Font,c004B76 s24 Underline Q4, Segoe UI Black
  392.                 Gui,1:Add,Text,cWhite center x82 y-2 w250 BackgroundTrans,2048
  393.                 Gui,1:Add,Text, center x81 y-3 w250 BackgroundTrans gMove_Window,2048
  394.                 Gui,1:Font,
  395.                 Gui,1:Font,c004B76 s22 Q4, Segoe UI Black
  396.                 Gui,1:Add,Text,cWhite x346 y-3 w20 r1 Center BackgroundTrans,-
  397.                 Gui,1:Add,Text, x345 y-4 w20 r1 Center BackgroundTrans gMin_Window,-
  398.                 Gui,1:Add,Text,cWhite x371 y-3 w23 r1 Center BackgroundTrans,x
  399.                 Gui,1:Add,Text, x370 y-4 w23 r1 Center BackgroundTrans gGuiClose,x
  400.                 Gui,1:Font,
  401.                 Gui,1:Font,c004B76 s16 Q4, Segoe UI Black
  402.                 Gui,1:Add,Picture, x48 y50 w2 h42,border.png
  403.                 Gui,1:Add,Picture, x50 y52 w2 h38,border2.png
  404.                 Gui,1:Add,Picture, x350 y50 w2 h42,border.png
  405.                 Gui,1:Add,Picture, x348 y52 w2 h38,border2.png
  406.                 Gui,1:Add,Picture, x50 y50 w300 ,border.png
  407.                 Gui,1:Add,Picture, x52 y52 w296 ,border2.png
  408.                 Gui,1:Add,Picture, x50 y90 w300 ,border.png
  409.                 Gui,1:Add,Picture, x52 y88 w296 ,border2.png
  410.                 Gui,1:Add,Text, x-1400 y-1170  Center BackgroundTrans vgw,% "1: " Names[1] " " Scores[1] "          2: " Names[2] " " Scores[2] "          3: " Names[3] " " Scores[3] "          "
  411.                 GuiControlGet,pos,1:pos,gw
  412.                 Gui,1:Add,Text,cWhite x30 y95 w65 r1 BackgroundTrans,Score:
  413.                 Gui,1:Add,Text,x29 y94 w65 r1 BackgroundTrans,Score:
  414.                 Gui,1:Add,Text,cWhite x+10 y95 w100 r1 BackgroundTrans vMy_Score,% My_Score
  415.                 Gui,1:Add,Picture,x0 y0 w400 h2,Border.png
  416.                 Gui,1:Add,Picture,x2 y2 w400 h2,Border2.png
  417.                 Gui,1:Add,Picture,x0 y0 w2 h560,Border.png
  418.                 Gui,1:Add,Picture,x2 y2 w2 h556,Border2.png
  419.                 Gui,1:Add,Picture,x398 y0 w2 h560,Border.png
  420.                 Gui,1:Add,Picture,x396 y2 w2 h556,Border2.png
  421.                 Gui,1:Add,Picture,x0 y558 w400 h2,Border.png
  422.                 Gui,1:Add,Picture,x2 y556 w396 h2,Border2.png
  423.                 Gui,1:Add,Picture,x125 y500 w150 h40 gNew_Game,New Game.png
  424.                 Gui,3:+Parent1 -caption -DPIScale
  425.                 Gui,3:Color,111111
  426.                 Gui,3:Font,c004B76 s16 Q4, Segoe UI Black
  427.                 Gui,3:Add,Text,cffffff x%score_x% y0 w%posw% r1 BackgroundTrans vss,% "1: " Names[1] " " Scores[1] "          2: " Names[2] " " Scores[2] "          3: " Names[3] " " Scores[3] "          "
  428.                 Gui,2:+parent1 -Caption +LastFound +AlwaysOnTop -DPIScale
  429.                 Gui,2:Add,ActiveX,x0 y0 w400 h400 vWB,MSHTML:
  430.                 WB.Body.Style.Position:="Absolute"
  431.                 Style:=WB.Body.Style
  432.                 for k,v in {margin:"0px"}
  433.                     Style[k]:=v
  434.                 WB.Body.Style.BackgroundColor:="#111111"
  435.                 img:=WB.CreateElement("img")
  436.                 This.img:=img
  437.                 img.src:=A_WorkingDir "\Background.png"
  438.                 Style:=img.Style
  439.                 for a,b in {Left:25,top:25,position:"absolute",width:350,height:350}
  440.                 Style[a]:=b
  441.                 WB.Body.AppendChild(This.img)
  442.                 sleep,300
  443.                 Gui,1:Show,w400 h560,2048
  444.                 Gui,2:Show,x0 y110 w400 h400
  445.                 Gui,3:Show,x52 y55 w298
  446.                 SetTimer,Score_Scroll,30   
  447.                 This.Build_Grid()
  448.                 Loop 2
  449.                     Tiles[Tiles.Length()+1]:=New Game_Tile()
  450.             }
  451.         Build_Grid()
  452.             {
  453.                 i:=1
  454.                 Loop 4
  455.                     {
  456.                         j:=1
  457.                         Loop 4
  458.                             {
  459.                                 Grid_Array[i,j]:=0,j++
  460.                             }
  461.                         i++
  462.                     }
  463.             }
  464.     }
  465. Create_Game_Assets()
  466.     {
  467.         FileCreateDir,%A_ScriptDir%/2048 Assets
  468.         SetWorkingDir,%A_ScriptDir%/2048 Assets
  469.         FileSetAttrib, -RH,scores.txt
  470.         FileDelete,%A_ScriptDir%/2048 Assets/scores.txt
  471.         FileAppend,Hellbent 5555*CivReborn 2000*HB 1000,%A_ScriptDir%/2048 Assets/scores.txt
  472.         FileSetAttrib, +RH,%A_ScriptDir%/2048 Assets/scores.txt
  473.         If !pToken := Gdip_Startup()
  474.             {
  475.                 MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
  476.                 ExitApp
  477.             }
  478.         Colours:= ["0xffFF6A00","0xff108Bb6","0xffB6FF00","0xff00FF21","0xff9bFFb0","0xffaaa4FF","0xff0026FF","0xff4800FF","0xffFF00DC","0xff7F0037","0xff007F7F","0xFF3388aa","0xFFaa5509"]
  479.         Text_:=[2,4,8,16,32,64,128,256,512,1024,2048,4096,8192],Font_Size:=[48,48,48,38,38,38,28,28,28,22,22,22,22],y_Pos1:=[4,4,4,12,12,12,20,20,20,24,24,24,24],y_Pos2:=[2,2,2,10,10,10,18,18,18,22,22,22,22]
  480.         Loop 13
  481.             {
  482.                 pBitmap := Gdip_CreateBitmap(75,75),G := Gdip_GraphicsFromImage(pBitmap)
  483.                 Gdip_SetSmoothingMode(G, 1)
  484.                 pBrush := Gdip_BrushCreateSolid(Colours[A_Index])
  485.                 Gdip_FillRectangle(G, pBrush, 1,1 , 75, 75)
  486.                 Gdip_DeleteBrush(pBrush)
  487.                 pPen := Gdip_CreatePen(0xffffffff, 2)
  488.                 Gdip_DrawRectangle(G, pPen, 1, 1, 73, 73)
  489.                 Gdip_DeleteBrush(pPen)
  490.                 pPen := Gdip_CreatePen(0xff000000, 2)
  491.                 Gdip_DrawRectangle(G, pPen, 3, 3, 69, 69)
  492.                 Gdip_DeleteBrush(pPen)
  493.                 Font = Segoe UI Black
  494.                 If !Gdip_FontFamilyCreate(Font)
  495.                     {
  496.                        ;~ MsgBox, 48, Font error!, The font you have specified does not exist on the system
  497.                        ;~ ExitApp
  498.                       Font = Arial
  499.                     }  
  500.                 Options =% "x4 y" y_Pos1[A_Index]  "cffffffff Center s" Font_Size[A_Index]
  501.                 Gdip_TextToGraphics(G, Text_[A_Index], Options, Font, 75, 75)  
  502.                 Options =% "x1 y" y_Pos2[A_Index]  "cff000000  Center s" Font_Size[A_Index]  
  503.                 Gdip_TextToGraphics(G, Text_[A_Index], Options, Font, 75, 75)  
  504.                 Gdip_SaveBitmapToFile(pBitmap,Text_[A_Index] ".png")
  505.                 Gdip_DisposeImage(pBitmap) 
  506.             }
  507.         pBitmap := Gdip_CreateBitmap(350,350),G := Gdip_GraphicsFromImage(pBitmap)
  508.         Gdip_SetSmoothingMode(G, 1)
  509.         pBrush := Gdip_BrushCreateSolid("0xFF004B76")
  510.         Gdip_FillRectangle(G, pBrush, 1,1 , 350, 350)
  511.         Gdip_DeleteBrush(pBrush)
  512.         pBrush := Gdip_BrushCreateSolid("0xFF222222")
  513.         Gdip_FillRectangle(G, pBrush, 11,11 , 329, 329)
  514.         Gdip_DeleteBrush(pBrush)
  515.         pBrush := Gdip_BrushCreateSolid("0xFF004B76"),x:=86
  516.         Loop 3
  517.             {
  518.                 Gdip_FillRectangle(G, pBrush,x,11 ,10, 340)
  519.                 x+=85
  520.             }
  521.         y:=86
  522.         Loop 3
  523.             {
  524.                 Gdip_FillRectangle(G, pBrush,11,y ,340, 10)
  525.                 y+=85  
  526.             }
  527.         Gdip_DeleteBrush(pBrush)
  528.         pPen := Gdip_CreatePen(0xffffffff, 2)
  529.         Gdip_DrawRectangle(G, pPen, 1, 1, 348, 348)
  530.         Gdip_DeleteBrush(pPen)
  531.         Gdip_SaveBitmapToFile(pBitmap,"Background.png")
  532.         Gdip_DisposeImage(pBitmap) 
  533.         pBitmap := Gdip_CreateBitmap(30,30)
  534.         G := Gdip_GraphicsFromImage(pBitmap)
  535.         Gdip_SetSmoothingMode(G, 1)
  536.         pBrush := Gdip_BrushCreateSolid("0xff004B76")
  537.         Gdip_FillRectangle(G, pBrush, 0,0 , 30, 30)
  538.         Gdip_DeleteBrush(pBrush)
  539.         pPen := Gdip_CreatePen(0xffffffff, 2)
  540.         Gdip_DrawRectangle(G, pPen, 1, 1, 28, 28)
  541.         Gdip_DeleteBrush(pPen)
  542.         Font = Segoe UI Black
  543.         If !Gdip_FontFamilyCreate(Font)
  544.                     {
  545.                        ;~ MsgBox, 48, Font error!, The font you have specified does not exist on the system
  546.                        ;~ ExitApp
  547.                       Font = Arial
  548.                     }  
  549.         Options =x1 y6  cff000000 Center s14
  550.         Gdip_TextToGraphics(G, "HB", Options, Font, 30, 30)
  551.         Options =x0 y5  cffffffff Center s14
  552.         Gdip_TextToGraphics(G, "HB", Options, Font, 30, 30)
  553.         Gdip_SaveBitmapToFile(pBitmap,"Tag.png")
  554.         Gdip_DisposeImage(pBitmap) 
  555.         pBitmap := Gdip_CreateBitmap(150,40)
  556.         G := Gdip_GraphicsFromImage(pBitmap)
  557.         Gdip_SetSmoothingMode(G, 1)
  558.         pBrush := Gdip_BrushCreateSolid("0xFF333333")
  559.         Gdip_FillRectangle(G, pBrush, 0,0 , 150, 40)
  560.         Gdip_DeleteBrush(pBrush)
  561.         pPen := Gdip_CreatePen(0xffffffff, 2)
  562.         Gdip_DrawRectangle(G, pPen, 1, 1, 148, 38)
  563.         Gdip_DeleteBrush(pPen)
  564.         Font = Segoe UI Black
  565.         If !Gdip_FontFamilyCreate(Font)
  566.                     {
  567.                        ;~ MsgBox, 48, Font error!, The font you have specified does not exist on the system
  568.                        ;~ ExitApp
  569.                       Font = Arial
  570.                     }  
  571.         Options =x0 y4  cffffffff Center s24
  572.         Gdip_TextToGraphics(G, "New Game", Options, Font, 150, 40) 
  573.         Options =x-1 y3  cff004B76 Center s24
  574.         Gdip_TextToGraphics(G, "New Game", Options, Font, 150, 40) 
  575.         Gdip_SaveBitmapToFile(pBitmap,"New Game.png")
  576.         Gdip_DisposeImage(pBitmap) 
  577.         pBitmap := Gdip_CreateBitmap(2,2)
  578.         G := Gdip_GraphicsFromImage(pBitmap)
  579.         Gdip_SetSmoothingMode(G, 1)
  580.         pBrush := Gdip_BrushCreateSolid("0xFF004B76")
  581.         Gdip_FillRectangle(G, pBrush, 0,0 , 2,2)
  582.         Gdip_DeleteBrush(pBrush)
  583.         Gdip_SaveBitmapToFile(pBitmap,"border.png")
  584.         Gdip_DisposeImage(pBitmap) 
  585.         pBitmap := Gdip_CreateBitmap(2,2)
  586.         G := Gdip_GraphicsFromImage(pBitmap)
  587.         Gdip_SetSmoothingMode(G, 1)
  588.         pBrush := Gdip_BrushCreateSolid("0xFFFaFaFa")
  589.         Gdip_FillRectangle(G, pBrush, 0,0 , 2,2)
  590.         Gdip_DeleteBrush(pBrush)
  591.         Gdip_SaveBitmapToFile(pBitmap,"border2.png")
  592.         Gdip_DisposeImage(pBitmap) 
  593.         Gdip_Shutdown(pToken)
  594.     }
  595. Gdip_Startup()
  596.     {
  597.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  598.        
  599.         if !DllCall("GetModuleHandle", "str", "gdiplus", Ptr)
  600.             DllCall("LoadLibrary", "str", "gdiplus")
  601.         VarSetCapacity(si, A_PtrSize = 8 ? 24 : 16, 0), si := Chr(1)
  602.         DllCall("gdiplus\GdiplusStartup", A_PtrSize ? "UPtr*" : "uint*", pToken, Ptr, &si, Ptr, 0)
  603.         return pToken
  604.     }
  605.  
  606. Gdip_Shutdown(pToken)
  607.     {
  608.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  609.        
  610.         DllCall("gdiplus\GdiplusShutdown", Ptr, pToken)
  611.         if hModule := DllCall("GetModuleHandle", "str", "gdiplus", Ptr)
  612.             DllCall("FreeLibrary", Ptr, hModule)
  613.         return 0
  614.     }
  615. Gdip_CreateBitmap(Width, Height, Format=0x26200A)
  616.     {
  617.         DllCall("gdiplus\GdipCreateBitmapFromScan0", "int", Width, "int", Height, "int", 0, "int", Format, A_PtrSize ? "UPtr" : "UInt", 0, A_PtrSize ? "UPtr*" : "uint*", pBitmap)
  618.         Return pBitmap
  619.     }
  620. Gdip_GraphicsFromImage(pBitmap)
  621.     {
  622.         DllCall("gdiplus\GdipGetImageGraphicsContext", A_PtrSize ? "UPtr" : "UInt", pBitmap, A_PtrSize ? "UPtr*" : "UInt*", pGraphics)
  623.         return pGraphics
  624.     }
  625. Gdip_SetSmoothingMode(pGraphics, SmoothingMode)
  626.     {
  627.        return DllCall("gdiplus\GdipSetSmoothingMode", A_PtrSize ? "UPtr" : "UInt", pGraphics, "int", SmoothingMode)
  628.     }
  629. Gdip_BrushCreateSolid(ARGB=0xff000000)
  630.     {
  631.         DllCall("gdiplus\GdipCreateSolidFill", "UInt", ARGB, A_PtrSize ? "UPtr*" : "UInt*", pBrush)
  632.         return pBrush
  633.     }
  634. Gdip_FillRectangle(pGraphics, pBrush, x, y, w, h)
  635.     {
  636.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  637.        
  638.         return DllCall("gdiplus\GdipFillRectangle"
  639.                         , Ptr, pGraphics
  640.                         , Ptr, pBrush
  641.                         , "float", x
  642.                         , "float", y
  643.                         , "float", w
  644.                         , "float", h)
  645.     }
  646. Gdip_DeleteBrush(pBrush)
  647.     {
  648.        return DllCall("gdiplus\GdipDeleteBrush", A_PtrSize ? "UPtr" : "UInt", pBrush)
  649.     }
  650. Gdip_CreatePen(ARGB, w)
  651.     {
  652.        DllCall("gdiplus\GdipCreatePen1", "UInt", ARGB, "float", w, "int", 2, A_PtrSize ? "UPtr*" : "UInt*", pPen)
  653.        return pPen
  654.     }
  655. Gdip_DrawRectangle(pGraphics, pPen, x, y, w, h)
  656.     {
  657.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  658.        
  659.         return DllCall("gdiplus\GdipDrawRectangle", Ptr, pGraphics, Ptr, pPen, "float", x, "float", y, "float", w, "float", h)
  660.     }
  661. Gdip_FontFamilyCreate(Font)
  662.     {
  663.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  664.        
  665.         if (!A_IsUnicode)
  666.         {
  667.             nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &Font, "int", -1, "uint", 0, "int", 0)
  668.             VarSetCapacity(wFont, nSize*2)
  669.             DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &Font, "int", -1, Ptr, &wFont, "int", nSize)
  670.         }
  671.        
  672.         DllCall("gdiplus\GdipCreateFontFamilyFromName"
  673.                         , Ptr, A_IsUnicode ? &Font : &wFont
  674.                         , "uint", 0
  675.                         , A_PtrSize ? "UPtr*" : "UInt*", hFamily)
  676.        
  677.         return hFamily
  678.     }  
  679. Gdip_TextToGraphics(pGraphics, Text, Options, Font="Arial", Width="", Height="", Measure=0)
  680.     {
  681.         IWidth := Width, IHeight:= Height
  682.         RegExMatch(Options, "i)X([\-\d\.]+)(p*)", xpos)
  683.         RegExMatch(Options, "i)Y([\-\d\.]+)(p*)", ypos)
  684.         RegExMatch(Options, "i)W([\-\d\.]+)(p*)", Width)
  685.         RegExMatch(Options, "i)H([\-\d\.]+)(p*)", Height)
  686.         RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
  687.         RegExMatch(Options, "i)Top|Up|Bottom|Down|vCentre|vCenter", vPos)
  688.         RegExMatch(Options, "i)NoWrap", NoWrap)
  689.         RegExMatch(Options, "i)R(\d)", Rendering)
  690.         RegExMatch(Options, "i)S(\d+)(p*)", Size)
  691.         if !Gdip_DeleteBrush(Gdip_CloneBrush(Colour2))
  692.             PassBrush := 1, pBrush := Colour2
  693.         if !(IWidth && IHeight) && (xpos2 || ypos2 || Width2 || Height2 || Size2)
  694.             return -1
  695.         Style := 0, Styles := "Regular|Bold|Italic|BoldItalic|Underline|Strikeout"
  696.         Loop, Parse, Styles, |
  697.             {
  698.                 if RegExMatch(Options, "\b" A_loopField)
  699.                 Style |= (A_LoopField != "StrikeOut") ? (A_Index-1) : 8
  700.             }
  701.         Align := 0, Alignments := "Near|Left|Centre|Center|Far|Right"
  702.         Loop, Parse, Alignments, |
  703.             {
  704.                 if RegExMatch(Options, "\b" A_loopField)
  705.                     Align |= A_Index//2.1      ; 0|0|1|1|2|2
  706.             }
  707.         xpos := (xpos1 != "") ? xpos2 ? IWidth*(xpos1/100) : xpos1 : 0
  708.         ypos := (ypos1 != "") ? ypos2 ? IHeight*(ypos1/100) : ypos1 : 0
  709.         Width := Width1 ? Width2 ? IWidth*(Width1/100) : Width1 : IWidth
  710.         Height := Height1 ? Height2 ? IHeight*(Height1/100) : Height1 : IHeight
  711.         if !PassBrush
  712.             Colour := "0x" (Colour2 ? Colour2 : "ff000000")
  713.         Rendering := ((Rendering1 >= 0) && (Rendering1 <= 5)) ? Rendering1 : 4
  714.         Size := (Size1 > 0) ? Size2 ? IHeight*(Size1/100) : Size1 : 12
  715.         hFamily := Gdip_FontFamilyCreate(Font)
  716.         hFont := Gdip_FontCreate(hFamily, Size, Style)
  717.         FormatStyle := NoWrap ? 0x4000 | 0x1000 : 0x4000
  718.         hFormat := Gdip_StringFormatCreate(FormatStyle)
  719.         pBrush := PassBrush ? pBrush : Gdip_BrushCreateSolid(Colour)
  720.         if !(hFamily && hFont && hFormat && pBrush && pGraphics)
  721.             return !pGraphics ? -2 : !hFamily ? -3 : !hFont ? -4 : !hFormat ? -5 : !pBrush ? -6 : 0
  722.         CreateRectF(RC, xpos, ypos, Width, Height)
  723.         Gdip_SetStringFormatAlign(hFormat, Align)
  724.         Gdip_SetTextRenderingHint(pGraphics, Rendering)
  725.         ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)
  726.         if vPos
  727.             {
  728.                 StringSplit, ReturnRC, ReturnRC, |
  729.                
  730.                 if (vPos = "vCentre") || (vPos = "vCenter")
  731.                     ypos += (Height-ReturnRC4)//2
  732.                 else if (vPos = "Top") || (vPos = "Up")
  733.                     ypos := 0
  734.                 else if (vPos = "Bottom") || (vPos = "Down")
  735.                     ypos := Height-ReturnRC4
  736.                
  737.                 CreateRectF(RC, xpos, ypos, Width, ReturnRC4)
  738.                 ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)
  739.             }
  740.         if !Measure
  741.             E := Gdip_DrawString(pGraphics, Text, hFont, hFormat, pBrush, RC)
  742.         if !PassBrush
  743.             Gdip_DeleteBrush(pBrush)
  744.         Gdip_DeleteStringFormat(hFormat)  
  745.         Gdip_DeleteFont(hFont)
  746.         Gdip_DeleteFontFamily(hFamily)
  747.         return E ? E : ReturnRC
  748.     }  
  749. Gdip_SaveBitmapToFile(pBitmap, sOutput, Quality=75)
  750.     {
  751.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  752.         SplitPath, sOutput,,, Extension
  753.         if Extension not in BMP,DIB,RLE,JPG,JPEG,JPE,JFIF,GIF,TIF,TIFF,PNG
  754.             return -1
  755.         Extension := "." Extension
  756.         DllCall("gdiplus\GdipGetImageEncodersSize", "uint*", nCount, "uint*", nSize)
  757.         VarSetCapacity(ci, nSize)
  758.         DllCall("gdiplus\GdipGetImageEncoders", "uint", nCount, "uint", nSize, Ptr, &ci)
  759.         if !(nCount && nSize)
  760.             return -2
  761.         If (A_IsUnicode){
  762.             StrGet_Name := "StrGet"
  763.             Loop, %nCount%
  764.                 {
  765.                     sString := %StrGet_Name%(NumGet(ci, (idx := (48+7*A_PtrSize)*(A_Index-1))+32+3*A_PtrSize), "UTF-16")
  766.                     if !InStr(sString, "*" Extension)
  767.                         continue
  768.                     pCodec := &ci+idx
  769.                     break
  770.                 }
  771.         } else {
  772.             Loop, %nCount%
  773.                 {
  774.                     Location := NumGet(ci, 76*(A_Index-1)+44)
  775.                     nSize := DllCall("WideCharToMultiByte", "uint", 0, "uint", 0, "uint", Location, "int", -1, "uint", 0, "int",  0, "uint", 0, "uint", 0)
  776.                     VarSetCapacity(sString, nSize)
  777.                     DllCall("WideCharToMultiByte", "uint", 0, "uint", 0, "uint", Location, "int", -1, "str", sString, "int", nSize, "uint", 0, "uint", 0)
  778.                     if !InStr(sString, "*" Extension)
  779.                         continue
  780.                     pCodec := &ci+76*(A_Index-1)
  781.                     break
  782.                 }
  783.         }
  784.         if !pCodec
  785.             return -3
  786.         if (Quality != 75)
  787.             {
  788.                 Quality := (Quality < 0) ? 0 : (Quality > 100) ? 100 : Quality
  789.                 if Extension in .JPG,.JPEG,.JPE,.JFIF
  790.                     {
  791.                         DllCall("gdiplus\GdipGetEncoderParameterListSize", Ptr, pBitmap, Ptr, pCodec, "uint*", nSize)
  792.                         VarSetCapacity(EncoderParameters, nSize, 0)
  793.                         DllCall("gdiplus\GdipGetEncoderParameterList", Ptr, pBitmap, Ptr, pCodec, "uint", nSize, Ptr, &EncoderParameters)
  794.                         Loop, % NumGet(EncoderParameters, "UInt")      ;%
  795.                             {
  796.                                 elem := (24+(A_PtrSize ? A_PtrSize : 4))*(A_Index-1) + 4 + (pad := A_PtrSize = 8 ? 4 : 0)
  797.                                 if (NumGet(EncoderParameters, elem+16, "UInt") = 1) && (NumGet(EncoderParameters, elem+20, "UInt") = 6)
  798.                                 {
  799.                                     p := elem+&EncoderParameters-pad-4
  800.                                     NumPut(Quality, NumGet(NumPut(4, NumPut(1, p+0)+20, "UInt")), "UInt")
  801.                                     break
  802.                                 }
  803.                             }      
  804.                     }
  805.             }
  806.         if (!A_IsUnicode)
  807.             {
  808.                 nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sOutput, "int", -1, Ptr, 0, "int", 0)
  809.                 VarSetCapacity(wOutput, nSize*2)
  810.                 DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sOutput, "int", -1, Ptr, &wOutput, "int", nSize)
  811.                 VarSetCapacity(wOutput, -1)
  812.                 if !VarSetCapacity(wOutput)
  813.                     return -4
  814.                 E := DllCall("gdiplus\GdipSaveImageToFile", Ptr, pBitmap, Ptr, &wOutput, Ptr, pCodec, "uint", p ? p : 0)
  815.             }
  816.         else
  817.             E := DllCall("gdiplus\GdipSaveImageToFile", Ptr, pBitmap, Ptr, &sOutput, Ptr, pCodec, "uint", p ? p : 0)
  818.         return E ? -5 : 0
  819.     }  
  820. Gdip_DisposeImage(pBitmap)
  821.     {
  822.        return DllCall("gdiplus\GdipDisposeImage", A_PtrSize ? "UPtr" : "UInt", pBitmap)
  823.     }  
  824. Gdip_CloneBrush(pBrush)
  825.     {
  826.         DllCall("gdiplus\GdipCloneBrush", A_PtrSize ? "UPtr" : "UInt", pBrush, A_PtrSize ? "UPtr*" : "UInt*", pBrushClone)
  827.         return pBrushClone
  828.     }  
  829. Gdip_FontCreate(hFamily, Size, Style=0)
  830.     {
  831.        DllCall("gdiplus\GdipCreateFont", A_PtrSize ? "UPtr" : "UInt", hFamily, "float", Size, "int", Style, "int", 0, A_PtrSize ? "UPtr*" : "UInt*", hFont)
  832.        return hFont
  833.     }  
  834. Gdip_StringFormatCreate(Format=0, Lang=0)
  835.     {
  836.        DllCall("gdiplus\GdipCreateStringFormat", "int", Format, "int", Lang, A_PtrSize ? "UPtr*" : "UInt*", hFormat)
  837.        return hFormat
  838.     }  
  839. CreateRectF(ByRef RectF, x, y, w, h)
  840.     {
  841.        VarSetCapacity(RectF, 16)
  842.        NumPut(x, RectF, 0, "float"), NumPut(y, RectF, 4, "float"), NumPut(w, RectF, 8, "float"), NumPut(h, RectF, 12, "float")
  843.     }  
  844. Gdip_SetStringFormatAlign(hFormat, Align)
  845.     {
  846.        return DllCall("gdiplus\GdipSetStringFormatAlign", A_PtrSize ? "UPtr" : "UInt", hFormat, "int", Align)
  847.     }  
  848. Gdip_SetTextRenderingHint(pGraphics, RenderingHint)
  849.     {
  850.         return DllCall("gdiplus\GdipSetTextRenderingHint", A_PtrSize ? "UPtr" : "UInt", pGraphics, "int", RenderingHint)
  851.     }  
  852. Gdip_MeasureString(pGraphics, sString, hFont, hFormat, ByRef RectF)
  853.     {
  854.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  855.         VarSetCapacity(RC, 16)
  856.         if !A_IsUnicode
  857.             {
  858.                 nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, "uint", 0, "int", 0)
  859.                 VarSetCapacity(wString, nSize*2)  
  860.                 DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, &wString, "int", nSize)
  861.             }
  862.         DllCall("gdiplus\GdipMeasureString"
  863.                         , Ptr, pGraphics
  864.                         , Ptr, A_IsUnicode ? &sString : &wString
  865.                         , "int", -1
  866.                         , Ptr, hFont
  867.                         , Ptr, &RectF
  868.                         , Ptr, hFormat
  869.                         , Ptr, &RC
  870.                         , "uint*", Chars
  871.                         , "uint*", Lines)
  872.         return &RC ? NumGet(RC, 0, "float") "|" NumGet(RC, 4, "float") "|" NumGet(RC, 8, "float") "|" NumGet(RC, 12, "float") "|" Chars "|" Lines : 0
  873.     }  
  874. Gdip_DrawString(pGraphics, sString, hFont, hFormat, pBrush, ByRef RectF)
  875.     {
  876.         Ptr := A_PtrSize ? "UPtr" : "UInt"
  877.         if (!A_IsUnicode)
  878.             {
  879.                 nSize := DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, 0, "int", 0)
  880.                 VarSetCapacity(wString, nSize*2)
  881.                 DllCall("MultiByteToWideChar", "uint", 0, "uint", 0, Ptr, &sString, "int", -1, Ptr, &wString, "int", nSize)
  882.             }
  883.         return DllCall("gdiplus\GdipDrawString"
  884.                         , Ptr, pGraphics
  885.                         , Ptr, A_IsUnicode ? &sString : &wString
  886.                         , "int", -1
  887.                         , Ptr, hFont
  888.                         , Ptr, &RectF
  889.                         , Ptr, hFormat
  890.                         , Ptr, pBrush)
  891.     }  
  892. Gdip_DeleteStringFormat(hFormat)
  893.     {
  894.        return DllCall("gdiplus\GdipDeleteStringFormat", A_PtrSize ? "UPtr" : "UInt", hFormat)
  895.     }  
  896. Gdip_DeleteFont(hFont)
  897.     {
  898.        return DllCall("gdiplus\GdipDeleteFont", A_PtrSize ? "UPtr" : "UInt", hFont)
  899.     }  
  900. Gdip_DeleteFontFamily(hFamily)
  901.     {
  902.        return DllCall("gdiplus\GdipDeleteFontFamily", A_PtrSize ? "UPtr" : "UInt", hFamily)
  903.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement