Create a Icon from pBitmap / hBitmap Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Create a Icon from pBitmap / hBitmap

25 Mar 2020, 07:20

Anyone know how to use a bitmap as a Icon (tray or w/e) without having to use any external resources? Is it even possible?
I have never had any interest in changing a scripts icon before, but I figured it might be time to look into it.

I'm only really interested in self contained code.

For example, if I wanted to take this and use it as a icon.

Code: Select all

HB_BITMAP_MAKER(){
	pBitmap := Gdip_CreateBitmap( 16 , 16 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF3399FF" )
	Gdip_FillRectangle( G , Brush , -1 , -1 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Create a Icon from pBitmap / hBitmap

25 Mar 2020, 08:42

As far as I know, you have to create an icon file from your image file using an external program, but I don’t see a reason why you couldn’t write the code to generate an icon format in AHK so it’s self-contained in your script. I don’t know how involved that would be.

Alternatively, you could use your code to generate the image, save it as a bmp or png file so you can use an icon generator app, then embed that icon file into your code using one of the binary-to-ASCII conversion routines. I know that’s not exactly what you’re looking for, but the end result would be self-contained.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

25 Mar 2020, 09:14

boiler wrote:
25 Mar 2020, 08:42
Alternatively, you could use your code to generate the image, save it as a bmp or png file so you can use an icon generator app, then embed that icon file into your code using one of the binary-to-ASCII conversion routines. I know that’s not exactly what you’re looking for, but the end result would be self-contained.
Would that be something like using Base64?

Something like this:

Code: Select all

This.B64.BlueBirdFrames := "iVBORw0KGgoAAAANSUhEUgAAAZAAAAAzCAYAAAC5QF44AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwA"
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap  Topic is solved

25 Mar 2020, 09:31

Hellbent wrote: For example, if I wanted to take this and use it as a icon.
It's pretty simple:

Code: Select all

#Persistent
pToken := Gdip_Startup()
pBitmap := HB_BITMAP_MAKER()
hIcon := Gdip_CreateHICONFromBitmap(pBitmap)
Gdip_DisposeImage(pBitmap)
Menu, Tray, Icon, HICON:%hIcon%
Gdip_Shutdown(pToken)

HB_BITMAP_MAKER(){
   pBitmap := Gdip_CreateBitmap( 16 , 16 ) 
   G := Gdip_GraphicsFromImage( pBitmap )
   Gdip_SetSmoothingMode( G , 2 )
   Brush := Gdip_BrushCreateSolid( "0xFF3399FF" )
   Gdip_FillRectangle( G , Brush , -1 , -1 , 18 , 18 )
   Gdip_DeleteBrush( Brush )
   Gdip_DeleteGraphics( G )
   return pBitmap
}
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

25 Mar 2020, 09:39

@teadrinker

Thank you very much.
That is exactly what I was hoping for.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 15:09

Hi @teadrinker .

Do you know any reason this would cause a error for some users?

Code: Select all

;*************************************************
;	In Auto-Execute Section
GDIP_Startup()
SetIcon() 	


;*************************************************

SetIcon(){
	pBitmap := HB_BITMAP_MAKER()
	hIcon := Gdip_CreateHICONFromBitmap(pBitmap)
	Gdip_DisposeImage(pBitmap)
	Menu, Tray, Icon, HICON:%hIcon%
}

;*************************************************

HB_BITMAP_MAKER(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 32 , 32 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrush( 10 , 13 , 19 , 25 , "0xFF004444" , "0xFF0D0D0D" , 1 ) , Gdip_FillEllipse( G , Brush , 1 , 1 , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawEllipse( G , Pen , 1 , 1 , 29 , 29 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF000000" , 1 ) , Gdip_DrawEllipse( G , Pen , 2 , 2 , 27 , 27 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x1 y2" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x3 y4" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF009999" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x2 y3" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 7 , 9 , 17 , 12 , "0x66009999" , "0x66000000" , 1 , 1 ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x2 y3" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
Commenting out *this fixed the error, but then there is no icon.

Code: Select all

SetIcon(){
	pBitmap := HB_BITMAP_MAKER()
	hIcon := Gdip_CreateHICONFromBitmap(pBitmap)
	Gdip_DisposeImage(pBitmap)
	;Menu, Tray, Icon, HICON:%hIcon%   ;<<<<<---------- *this
}
All of it works fine for me either way.
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 15:40

Hi
Hellbent wrote: Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x1 y2" , "Segoe ui" , 29 , 29 )
Not the brush should be here, but the color.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 15:55

teadrinker wrote:
04 Oct 2021, 15:40
Hi
Hellbent wrote: Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x1 y2" , "Segoe ui" , 29 , 29 )
Not the brush should be here, but the color.
The brush is valid.

It is how you can do gradient, or textured text.

Code: Select all

HB_BITMAP_MAKER(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 600 , 200 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF3399FF" , "0xFF000000" , 1 ) , Gdip_TextToGraphics( G , "Sample" , "s122 Center vCenter Bold c" Brush " x0 y0" , "Segoe ui" , 600 , 200 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
Temp (1).gif
Temp (1).gif (463.89 KiB) Viewed 1687 times
The same thing is used throughout the rest of the script without any issues. It is just changing the Icon that is the issue.
If it helps, the user was on windows 10.
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 17:40

Hellbent wrote: The brush is valid
Are you sure? In the standard GDIp.ahk Gdip_TextToGraphics() looks like this:

Code: Select all

Gdip_TextToGraphics(pGraphics, Text, Options, Font="Arial", Width="", Height="", Measure=0)
{
	IWidth := Width, IHeight:= Height
	
	RegExMatch(Options, "i)X([\-\d\.]+)(p*)", xpos)
	RegExMatch(Options, "i)Y([\-\d\.]+)(p*)", ypos)
	RegExMatch(Options, "i)W([\-\d\.]+)(p*)", Width)
	RegExMatch(Options, "i)H([\-\d\.]+)(p*)", Height)
	RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
	RegExMatch(Options, "i)Top|Up|Bottom|Down|vCentre|vCenter", vPos)
	RegExMatch(Options, "i)NoWrap", NoWrap)
	RegExMatch(Options, "i)R(\d)", Rendering)
	RegExMatch(Options, "i)S(\d+)(p*)", Size)
	...
RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
There is no such option like "Brush". Or are you using a non-standard library?
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 17:46

teadrinker wrote:
04 Oct 2021, 17:40
Hellbent wrote: The brush is valid
Are you sure? In the standard GDIp.ahk Gdip_TextToGraphics() looks like this:

Code: Select all

Gdip_TextToGraphics(pGraphics, Text, Options, Font="Arial", Width="", Height="", Measure=0)
{
	IWidth := Width, IHeight:= Height
	
	RegExMatch(Options, "i)X([\-\d\.]+)(p*)", xpos)
	RegExMatch(Options, "i)Y([\-\d\.]+)(p*)", ypos)
	RegExMatch(Options, "i)W([\-\d\.]+)(p*)", Width)
	RegExMatch(Options, "i)H([\-\d\.]+)(p*)", Height)
	RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
	RegExMatch(Options, "i)Top|Up|Bottom|Down|vCentre|vCenter", vPos)
	RegExMatch(Options, "i)NoWrap", NoWrap)
	RegExMatch(Options, "i)R(\d)", Rendering)
	RegExMatch(Options, "i)S(\d+)(p*)", Size)
	...
RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
There is no such option like "Brush". Or are you using a non-standard library?
This here.

Code: Select all

if !Gdip_DeleteBrush(Gdip_CloneBrush(Colour2))
		PassBrush := 1, pBrush := Colour2

;*EDIT* 		
;This too

if !PassBrush
		Colour := "0x" (Colour2 ? Colour2 : "ff000000")	
		
;And 

pBrush := PassBrush ? pBrush : Gdip_BrushCreateSolid(Colour)			

My copy of the function.

Code: Select all

;#####################################################################################

Gdip_TextToGraphics(pGraphics, Text, Options, Font="Arial", Width="", Height="", Measure=0)
{
	IWidth := Width, IHeight:= Height
	
	RegExMatch(Options, "i)X([\-\d\.]+)(p*)", xpos)
	RegExMatch(Options, "i)Y([\-\d\.]+)(p*)", ypos)
	RegExMatch(Options, "i)W([\-\d\.]+)(p*)", Width)
	RegExMatch(Options, "i)H([\-\d\.]+)(p*)", Height)
	RegExMatch(Options, "i)C(?!(entre|enter))([a-f\d]+)", Colour)
	RegExMatch(Options, "i)Top|Up|Bottom|Down|vCentre|vCenter", vPos)
	RegExMatch(Options, "i)NoWrap", NoWrap)
	RegExMatch(Options, "i)R(\d)", Rendering)
	RegExMatch(Options, "i)S(\d+)(p*)", Size)

	if !Gdip_DeleteBrush(Gdip_CloneBrush(Colour2))
		PassBrush := 1, pBrush := Colour2
	
	if !(IWidth && IHeight) && (xpos2 || ypos2 || Width2 || Height2 || Size2)
		return -1

	Style := 0, Styles := "Regular|Bold|Italic|BoldItalic|Underline|Strikeout"
	Loop, Parse, Styles, |
	{
		if RegExMatch(Options, "\b" A_loopField)
		Style |= (A_LoopField != "StrikeOut") ? (A_Index-1) : 8
	}
  
	Align := 0, Alignments := "Near|Left|Centre|Center|Far|Right"
	Loop, Parse, Alignments, |
	{
		if RegExMatch(Options, "\b" A_loopField)
			Align |= A_Index//2.1      ; 0|0|1|1|2|2
	}

	xpos := (xpos1 != "") ? xpos2 ? IWidth*(xpos1/100) : xpos1 : 0
	ypos := (ypos1 != "") ? ypos2 ? IHeight*(ypos1/100) : ypos1 : 0
	Width := Width1 ? Width2 ? IWidth*(Width1/100) : Width1 : IWidth
	Height := Height1 ? Height2 ? IHeight*(Height1/100) : Height1 : IHeight
	if !PassBrush
		Colour := "0x" (Colour2 ? Colour2 : "ff000000")
	Rendering := ((Rendering1 >= 0) && (Rendering1 <= 5)) ? Rendering1 : 4
	Size := (Size1 > 0) ? Size2 ? IHeight*(Size1/100) : Size1 : 12

	hFamily := Gdip_FontFamilyCreate(Font)
	hFont := Gdip_FontCreate(hFamily, Size, Style)
	FormatStyle := NoWrap ? 0x4000 | 0x1000 : 0x4000
	hFormat := Gdip_StringFormatCreate(FormatStyle)
	pBrush := PassBrush ? pBrush : Gdip_BrushCreateSolid(Colour)
	if !(hFamily && hFont && hFormat && pBrush && pGraphics)
		return !pGraphics ? -2 : !hFamily ? -3 : !hFont ? -4 : !hFormat ? -5 : !pBrush ? -6 : 0
   
	CreateRectF(RC, xpos, ypos, Width, Height)
	Gdip_SetStringFormatAlign(hFormat, Align)
	Gdip_SetTextRenderingHint(pGraphics, Rendering)
	ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)

	if vPos
	{
		StringSplit, ReturnRC, ReturnRC, |
		
		if (vPos = "vCentre") || (vPos = "vCenter")
			ypos += (Height-ReturnRC4)//2
		else if (vPos = "Top") || (vPos = "Up")
			ypos := 0
		else if (vPos = "Bottom") || (vPos = "Down")
			ypos := Height-ReturnRC4
		
		CreateRectF(RC, xpos, ypos, Width, ReturnRC4)
		ReturnRC := Gdip_MeasureString(pGraphics, Text, hFont, hFormat, RC)
	}

	if !Measure
		E := Gdip_DrawString(pGraphics, Text, hFont, hFormat, pBrush, RC)

	if !PassBrush
		Gdip_DeleteBrush(pBrush)
	Gdip_DeleteStringFormat(hFormat)   
	Gdip_DeleteFont(hFont)
	Gdip_DeleteFontFamily(hFamily)
	return E ? E : ReturnRC
}



teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 18:37

Ah, yeah, in the standard lib the same, I didn't know about it.
Hellbent wrote: Do you know any reason this would cause a error for some users?
You need to log what each of the GDIp functions returns.
iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 21:26

+1 to the suggestion of base64. There's no reason to be manually drawing a small icon. TextToGraphics is not the best function in the GDI+ library.

The following is entirely selfcontained

Code: Select all

; Credit to stardew valley
image := "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR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+gqE+XntQzNufnuBzxI2WMYNG+g0971SWGLhaioXNeMCCTdpZ4w7mmIM+5qBN69kjSfwre3WfOt1/q7BHTjRGzvREhnoj7/kip9oinU3feJt/q7MvSXXDjIymGFUjI72On9Io57RqEgaLSRNO1rgFnrHwjuUqgXApErJiATs67mCNOeCx/3MwL1qRDm18T5pkpVj3cUn+45ryBy0d95t8D1sOv2ho/V93/UeZNcviomGmth2Uucn8Sr6sQaPo1OLHUimjemjajo3YkXNuvFunAEIu5qwXedvPmIs57mBM2eCgBRl0gmVZgCud2ZPCHxZxVlSqcKp+OsUYTilaV+nC/H1HSRlH4jQNewR1sLhWJtmfjNen0gd02GU9esWIz7o4I27WmQrEVyAEZippE1U0fyV1xEOdtNNCZsZSCWvUBB3OIdZnJnbLhAMYd4InG5JlH5Xr+hUZ50RJp9iSenpSFVlZQZY2sMU+Fa87BerdRxw2Ipes2Kgd97tYo07obZbdBTAw6aGMV/z/vOCMgxoyQ4tGZNqGnC6F+/TCniSkh0sfEHHalaqDydo6tdKXJOoW85uF4kaRukWR3KZEfRraoA4ZMfPGnFy/C/c7ueNO9qSLESiL6ythAkEzErBAISc056WFvNC0E5pyMi+XM89XMIYtpBO63W0p79Skx7qyIZMON+bwq7KEjWqsTwb3aNi+DKgjF/Dlx50yCf2urCmXdNKCBcz8oFUScCKB/cCRUhgIO/FZG2PWQZ91QW9Pe8IOjduZF5zwBRc6acOnivBzmawuNVqpFZiykjNztRn56rRsyb5MgW2foMsiPeYGB6zRfg9pxgHOOuKDlvigmRGwolMO6mT5z3qL8X8Dy9AogtyeekQAAAAASUVORK5CYII="

;#include ImagePut.ahk
;ImagePutWIndow({base64:image})
         DllCall("LoadLibrary", "str", "gdiplus")
         VarSetCapacity(si, A_PtrSize = 4 ? 16:24, 0) ; sizeof(GdiplusStartupInput) = 16, 24
            NumPut(0x1, si, "uint")
         DllCall("gdiplus\GdiplusStartup", "ptr*", pToken:=0, "ptr", &si, "ptr", 0)

      flags := 0x1
      DllCall("crypt32\CryptStringToBinary"
               , "ptr", &image, "uint", 0, "uint", flags, "ptr", 0, "uint*", size:=0, "ptr", 0, "ptr", 0)

      hData := DllCall("GlobalAlloc", "uint", 0x2, "uptr", size, "ptr")
      pData := DllCall("GlobalLock", "ptr", hData, "ptr")

      DllCall("crypt32\CryptStringToBinary"
               , "ptr", &image, "uint", 0, "uint", flags, "ptr", pData, "uint*", size, "ptr", 0, "ptr", 0)

      DllCall("GlobalUnlock", "ptr", hData)
      DllCall("ole32\CreateStreamOnHGlobal", "ptr", hData, "int", true, "ptr*", pStream:=0, "uint")

      DllCall("gdiplus\GdipCreateBitmapFromStream", "ptr", pStream, "ptr*", pBitmap:=0)
      ObjRelease(pStream)

      DllCall("gdiplus\GdipCreateHBITMAPFromBitmap", "ptr", pBitmap, "ptr*", hBitmap:=0, "uint", 0)
DllCall("gdiplus\GdipCreateHICONFromBitmap", "ptr", pBitmap, "ptr*", hIcon:=0)

      DllCall("gdiplus\GdipDisposeImage", "ptr", pBitmap)

         DllCall("gdiplus\GdiplusShutdown", "ptr", pToken)
         DllCall("FreeLibrary", "ptr", DllCall("GetModuleHandle", "str", "gdiplus", "ptr"))
Menu, Tray, Icon , HICON:%hicon%
This.B64.BlueBirdFrames := "iVBORw0KGgoAAAANSUhEUgAAAZAAAAAzCAYAAAC5QF44AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwA" is not an image.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 23:40

teadrinker wrote:
04 Oct 2021, 18:37
You need to log what each of the GDIp functions returns.
Ok thanks, I'll see if I can get some debug info.

Hey @Joe Glines, mind running a little test on that code lol.

Should just be a matter of replacing the old function with this one.

Code: Select all

SetIcon(){
	pBitmap := HB_BITMAP_MAKER()
	hIcon := Gdip_CreateHICONFromBitmap(pBitmap)
	
	Msgbox, % "pBitmap: " pBitmap "`nhIcon: " hIcon 
	
	Gdip_DisposeImage(pBitmap)
	Menu, Tray, Icon, HICON:%hIcon%
}
iseahound wrote:
04 Oct 2021, 21:26
+1 to the suggestion of base64. There's no reason to be manually drawing a small icon. TextToGraphics is not the best function in the GDI+ library.

This.B64.BlueBirdFrames := "iVBORw0KGgoAAAANSUhEUgAAAZAAAAAzCAYAAAC5QF44AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwA" is not an image.
Thanks you. That B64 was just something I stripped from another script of mine and I only grabbed enough to confirm what boiler was saying.
Here is the original.

Code: Select all

class PlayerBitmaps	{
	__New(){
		This._CreateMasters()
	}_CreateMasters(){
		This.B64 := {}
		This.B64.BlueBirdFrames := "iVBORw0KGgoAAAANSUhEUgAAAZAAAAAzCAYAAAC5QF44AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAARc0lEQVR4Xu2dCXhU5dXH3zszWUlCCAlbmEkkLFaJBUStIkRZBJVPrLJIUAofuJTNgkGWGlMFK1LEhAAGi6BGEIVaSxChFVH4lAqtKH6yiYpIhUhYs5FAOD3nLmQy3mRmkpnJnZvzf57fM3PfTHLPf+57Mu923xGNrChkDTILCaOCIBX7MJbM4mME8hjSXj4KXrEPY6nRfFjUR02ux3XJgaxDvkN2ITORKxFQWYIEg9iHsWQkHw3JD02RiFV5KvYi5KEQaU0FQST2YSw1ug9KhveQZPlIiFBkKxIvH7lXD6QMocA1vnIq+wEJBrEPY8koPlzzYwwyW3nqke5C9iMUczlSgPxNPSYmIcEg9mEsGcbHfQidcLV8JMREhI5z5SPP1BX5ENGCd+ZLJFjEPowlI/hwzg8aQjuFnERaIZ7IOan1mIEEg9iHsWQYH+tEjwHaSelDY7+IjKHnVcjzyFNesB3R/pZGFhIo2ZCBCI2R68XnKezDNzKDD+f8WC/CIkFYrPScYtKL1ZVnkAOI9jdcG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yLRoor9AO8+hbzuNCBtageTDV8qT4yQzizMRNaEVfhqygIOiYq9lGuXDnxDhNEqPNIBPahp44JgHVOvBMEQECns70XlHYlphMeYSovRPFVFAQd4fzQOIYdOzl9qXDhwpfxfg1OY3HN11BQ2pWEfhAeEBBwzDY9JOwDEemc3inOSkhIGO5nI8Fc6FZmMqex2IbFNQkJCYPhAbaJU/wJd98WnIa76lyckJCQsAJTPV2tSTE91NKalJCQYGCtQHGFj2a2siYlsg0ikpSUlJSUdJuamZKSkpKSkllRM1NSUlJSUjIramZKSkpKSkpmRc1MSUlJSUnJrKiZKSkpKSkpmRU1MyUlJSUlJbOiZqakpKSkpGRW1MyUlJSUlJTMipqZkpKSkpKSmZMM/we+Rgke+24mewAAAABJRU5ErkJggg=="
		This.MasterBitmap := []
		for k , v in This.B64 
			This.MasterBitmap[ A_Index ] := This._Create_Sheets( v )
		This._MapSplit()
	}_MapSplit(){
		local posx , Index := 1
		This.Players := []
		Loop, % This.MasterBitmap.Length()	{
			posx := 0
			Loop, 8	{
				This.Players[ Index , A_Index ] := {}
				This.Players[ Index , A_Index ].Bitmap := Gdip_CreateBitmap( 50 , 51 ) 
				This.Players[ Index , A_Index ].G := Gdip_GraphicsFromImage( This.Players[ Index , A_Index ].Bitmap )
				Gdip_SetSmoothingMode( This.Players[ Index , A_Index ].G , 2 )
				Gdip_DrawImage( This.Players[ Index , A_Index ].G , This.MasterBitmap[ Index ] , 0 , 0 , 50 , 51 , posx , 0 , 50 , 51 ) 
				posx += 50
			}
			Index++
		}
		Loop, % This.MasterBitmap.Length()
			Gdip_DisposeImage( This.MasterBitmap[ A_Index ] )
	}_Create_Sheets( B65 ){
		local ptr , uptr , pBitmap , B64
		VarSetCapacity(B64, strlen( B65 ) << !!A_IsUnicode)
		B64 := B65
		If !DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr := A_PtrSize ? "Ptr" : "UInt" , &B64, "UInt", 0, "UInt", 0x01, Ptr, 0, "UIntP", DecLen, Ptr, 0, Ptr, 0)
		   Return False
		VarSetCapacity(Dec, DecLen, 0)
		If !DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr, &B64, "UInt", 0, "UInt", 0x01, Ptr, &Dec, "UIntP", DecLen, Ptr, 0, Ptr, 0)
		   Return False
		DllCall("Kernel32.dll\RtlMoveMemory", Ptr, pData := DllCall("Kernel32.dll\GlobalLock", Ptr, hData := DllCall("Kernel32.dll\GlobalAlloc", "UInt", 2,  UPtr := A_PtrSize ? "UPtr" : "UInt" , DecLen, UPtr), UPtr) , Ptr, &Dec, UPtr, DecLen)
		DllCall("Kernel32.dll\GlobalUnlock", Ptr, hData)
		DllCall("Ole32.dll\CreateStreamOnHGlobal", Ptr, hData, "Int", True, Ptr "P", pStream)
		DllCall("Gdiplus.dll\GdipCreateBitmapFromStream",  Ptr, pStream, Ptr "P", pBitmap)
		return pBitmap
	}
}
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap

04 Oct 2021, 23:55

@iseahound
Easier:

Code: Select all

#Persistent
png32x32 := "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAvWSURBVEhLHZR5VFMHoodvHUWBQEhukpvk3tx7s5OdhCSAIFuAhCVkX1lV9lUkIGBVUMSKK4Q9wQRBdhXE6unMmZkz7Wln/mhPz+vpvL6Z19mc+vpmxr1WWq1mfO+c39/f9893fsDzLeH2Jvr6FiNyixLZor1aJ2+vU18sxr5ain8eIj0Jc+6HVf91rXD9cr6tiFRQLNCb9uqKcvWFJRM+zuP3ld/d4kXuYpEtSmQz/s0m+Oomdfs67dVNyvZyTOQ64eEiDry6nfh6C43cZkS2qC83Gc+uow/WBT8s0n8KEV8EwH8Fsa/nFYvn2b5+JLs1QdyB8jpFSJuMckD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WvUBB3OIdZnJnbLhAMYd4InG5JlH5Xr+hUZ50RJp9iSenpSFVlZQZY2sMU+Fa87BerdRxw2Ipes2Kgd97tYo07obZbdBTAw6aGMV/z/vOCMgxoyQ4tGZNqGnC6F+/TCniSkh0sfEHHalaqDydo6tdKXJOoW85uF4kaRukWR3KZEfRraoA4ZMfPGnFy/C/c7ueNO9qSLESiL6ythAkEzErBAISc056WFvNC0E5pyMi+XM89XMIYtpBO63W0p79Skx7qyIZMON+bwq7KEjWqsTwb3aNi+DKgjF/Dlx50yCf2urCmXdNKCBcz8oFUScCKB/cCRUhgIO/FZG2PWQZ91QW9Pe8IOjduZF5zwBRc6acOnivBzmawuNVqpFZiykjNztRn56rRsyb5MgW2foMsiPeYGB6zRfg9pxgHOOuKDlvigmRGwolMO6mT5z3qL8X8Dy9AogtyeekQAAAAASUVORK5CYII="

hIcon := CreateIconFromBase64(png32x32, 32)
Menu, Tray, Icon, HICON: %hIcon%

CreateIconFromBase64(base64, icoSize)
{
   chars := StrLen(base64)
   if !DllCall("Crypt32\CryptStringToBinary", "Str", base64, "UInt", chars, "UInt", 1
                                            , "Ptr", 0, "UIntP", bytes, "UIntP", 0, "UIntP", 0)
      throw "CryptStringToBinary failed. LastError: " . A_LastError
   VarSetCapacity(icoData, bytes, 0)
   DllCall("Crypt32\CryptStringToBinary", "Str", base64, "UInt", chars, "UInt", 1
                                        , "Str", icoData, "UIntP", bytes, "UIntP", 0, "UIntP", 0)
   Return DllCall("CreateIconFromResourceEx", "Ptr", &icoData, "UInt", bytes, "UInt", true
                                            , "UInt", 0x30000, "Int", icoSize, "Int", icoSize, "UInt", 0, "Ptr")
}
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 01:36

@teadrinker out of curiosity, do you get an error for the icon with this?

Code: Select all

;***************************************************************************************************
#Include <GDIP>  ;Your Path / File Name here
;***************************************************************************************************
#SingleInstance, Force
SetControlDelay, -1
SetBatchLines, -1
#NoEnv
global CurrentTab , DemoHwnd , Active := 0 , isPressed := 0 , DisplayHwnd
ptoken := GDIp_Startup()
SetIcon()
MainObj := {}
MainObj.ButtonHandles := []
MainObj.Edits := {}
MainObj.EditHandles := []
MainObj.Count := 1
SetDefaults( MainObj )
Main := New Custom_Window( x:= "" , y:= "" , w:= 1100 , h:= 590 , Name:= "1" , Options:= "+AlwaysOnTop -Caption -DPIScale" , Title:= "HB Button Maker v1.01" , Background_Bitmap:= Background() )
Gui,1:Add,Text,x10 y5 w610 h30 BackgroundTrans gMoveWindow
Gui, 1:Add, Text, x0 y0 w0 h0 BackgroundTrans hwndDemoHwnd gDemoPress
Gui,1:Color,22262a,071111
AddButtonOptionsPanel( MainObj )
AddFontPanel( MainObj )
AddTextColorPanel( MainObj )
AddGlossyPanel( MainObj )
AddButtonColorPanel( MainObj )
AddTabsPanel( MainObj )
AddControlPanel( MainObj )
AddDropDown( MainObj )
AddClosePanel( MainObj )
w:=460 , h:= 363
Gui, 1:Add, Pic, x320 y95 w%w% h%h% 0xE hwndPichwnd
SetImage( Pichwnd , handle := CenterPanel( w , h , MainObj.Tab[CurrentTab] , MainObj[MainObj.Tab[CurrentTab]] , MainObj ) ) , DeleteObject( handle )
Main.Show_Window()
lock := 1
For k, v in MainObj[MainObj.Tab[CurrentTab]]	{
	GuiControl, 1:, % MainObj.Edits[k], % v	
}
lock := 0
Gui, 1:Add, Edit,c00aacc x485 y50 w210 h22 -E0x200 Center hwndhwnd , MyButtonDesign
MainObj.ProjectName := hwnd
SetTimer, Hover, 60
return

GuiClose:
;~ GuiContextMenu:
;~ *ESC::
	ExitApp

MinimizeWindow:
	Gui, 1:Minimize
	return

GotoThreadTopic:
	soundbeep, 500
	return

SetIcon(){
	pBitmap := HB_BITMAP_MAKER()
	hIcon := Gdip_CreateHICONFromBitmap(pBitmap)
	Gdip_DisposeImage(pBitmap)
	Menu, Tray, Icon, HICON:%hIcon%
}
HB_BITMAP_MAKER(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 32 , 32 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrush( 10 , 13 , 19 , 25 , "0xFF004444" , "0xFF0D0D0D" , 1 ) , Gdip_FillEllipse( G , Brush , 1 , 1 , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawEllipse( G , Pen , 1 , 1 , 29 , 29 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF000000" , 1 ) , Gdip_DrawEllipse( G , Pen , 2 , 2 , 27 , 27 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x1 y2" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x3 y4" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF009999" ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x2 y3" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 7 , 9 , 17 , 12 , "0x66009999" , "0x66000000" , 1 , 1 ) , Gdip_TextToGraphics( G , "HB" , "s14 Center vCenter Bold c" Brush " x2 y3" , "Segoe ui" , 29 , 29 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
Export:
	
	if( MainObj.Count = 1 ){
		;~ ToolTip, % "Save PNG Set"
		SaveImage( MainObj )
	}else if( MainObj.Count = 2 ){
		;~ ToolTip, % "Clipboard Button Object"
		ClipButton( MainObj )
	
	}
	return
	
SaveImage( obj ){
	local Default , Hover , Pressed , All , G
	All := Gdip_CreateBitmap( obj.Default.ButtonPanelWidthEdit + obj.Hover.ButtonPanelWidthEdit + obj.Pressed.ButtonPanelWidthEdit , ( obj.Default.ButtonPanelHeightEdit >= obj.Hover.ButtonPanelHeightEdit ) ? ( ( obj.Default.ButtonPanelHeightEdit >= obj.Pressed.ButtonPanelHeightEdit ) ? ( obj.Default.ButtonPanelHeightEdit ) : ( obj.Pressed.ButtonPanelHeightEdit >= obj.Hover.ButtonPanelHeightEdit ) ? ( obj.Pressed.ButtonPanelHeightEdit ) : ( obj.Hover.ButtonPanelHeightEdit ) ) : ( ( obj.Pressed.ButtonPanelHeightEdit >= obj.Hover.ButtonPanelHeightEdit ) ? ( obj.Pressed.ButtonPanelHeightEdit ) : ( obj.Hover.ButtonPanelHeightEdit ) )   ) , G := Gdip_GraphicsFromImage( All ) , Gdip_SetSmoothingMode( G , 2 )
	
	IfNotExist, % A_ScriptDir "\Saved Buttons"
		FileCreateDir, % A_ScriptDir "\Saved Buttons"
	
	Default := _CreateDefaultBitmap( obj.Default.ButtonPanelWidthEdit , obj.Default.ButtonPanelHeightEdit , obj.Default )
	Gdip_SaveBitmapToFile( Default , A_ScriptDir "\Saved Buttons\" A_Now "_" obj.ProjectName "_Default.png"  , 100 ) 
	Gdip_DrawImage( G , Default , 0, 0, obj.Default.ButtonPanelWidthEdit , obj.Default.ButtonPanelHeightEdit ) 
	Gdip_DisposeImage( Default )
	
	Hover := _CreateDefaultBitmap( obj.Hover.ButtonPanelWidthEdit , obj.Hover.ButtonPanelHeightEdit , obj.Hover )
	Gdip_SaveBitmapToFile( Hover , A_ScriptDir "\Saved Buttons\" A_Now "_" obj.ProjectName "_Hover.png"  , 100 ) 
	Gdip_DrawImage( G , Hover , obj.Default.ButtonPanelWidthEdit , 0 , obj.Hover.ButtonPanelWidthEdit , obj.Hover.ButtonPanelHeightEdit )
	Gdip_DisposeImage( Hover )
	
	Pressed := _CreateDefaultBitmap( obj.Pressed.ButtonPanelWidthEdit , obj.Pressed.ButtonPanelHeightEdit , obj.Pressed )
	Gdip_SaveBitmapToFile( Pressed , A_ScriptDir "\Saved Buttons\" A_Now "_" obj.ProjectName "_Pressed.png"  , 100 ) 
	Gdip_DrawImage( G , Pressed , obj.Default.ButtonPanelWidthEdit + obj.Hover.ButtonPanelWidthEdit , 0 , obj.Pressed.ButtonPanelWidthEdit , obj.Pressed.ButtonPanelHeightEdit )
	Gdip_DisposeImage( Pressed )
	
	Gdip_SaveBitmapToFile( All , A_ScriptDir "\Saved Buttons\" A_Now "_" obj.ProjectName "_All.png"  , 100 ) 
	Gdip_DisposeImage( All )
	SoundBeep, 500
	SoundBeep, 500
}

AutoTimer:
	if(MainObj.Tab[CurrentTab]="All")
		return
	GetEdits( MainObj , CurrentTab )
	SetImage( Pichwnd , handle := CenterPanel( w , h , MainObj.Tab[CurrentTab] , MainObj[MainObj.Tab[CurrentTab]] , MainObj ) )
	DeleteObject( handle )
	SetDisplayWindow( MainObj )
	return

AutoUpdate:
	if( MainObj.AutoSwitchState := !MainObj.AutoSwitchState ){
		SetImage( MainObj.AutoSwitch , handle := AutoSwitchOn() ) , DeleteObject( handle )
		SetTimer, AutoTimer, 5000
		gosub, AutoTimer
	}else{
		SetImage( MainObj.AutoSwitch , handle := AutoSwitchOff() ) , DeleteObject( handle )
		SetTimer, AutoTimer, Off
	}
	return

DemoPress:
	SetTimer, Hover, Off
	isPressed := 1
	SetImage( Pichwnd , handle := CenterPanel( w , h , "Pressed" , MainObj.Pressed , MainObj ) ) , DeleteObject( handle )
	While(GetKeyState("LButton"))
		sleep, 30
	isPressed := 0
	MouseGetPos,,,,ctrl,2
	if(Ctrl!=DemoHwnd){
		Active := 0
		SetImage( Pichwnd , handle := CenterPanel( w , h , "All" , MainObj.Default , MainObj ) ) , DeleteObject( handle )
	}else{
		SetImage( Pichwnd , handle := CenterPanel( w , h , "Hover" , MainObj.Hover , MainObj ) ) , DeleteObject( handle )
	}
	SetTimer, Hover, On
	return
	
Hover:
	MouseGetPos,,,,Ctrl,2
	if(DemoHwnd=ctrl&&!Active){
		Active := 1
		SetImage( Pichwnd , handle := CenterPanel( w , h , "Hover" , MainObj.Hover , MainObj ) ) , DeleteObject( handle )
	}else if(DemoHwnd!=ctrl&&Active){
		Active := 0
		SetImage( Pichwnd , handle := CenterPanel( w , h , "All" , MainObj.Default , MainObj ) ) , DeleteObject( handle )
	}
	return

SwitchTabs:
	MouseGetPos,,,,ctrl,2
	if(CurrentTab = ctrl)
		return
	lock := 1
	SetImage( MainObj.TabsPanelHwnd , handle := Tabs( MainObj.Tab[ctrl] ) )
	DeleteObject( handle )
	GetEdits( MainObj , CurrentTab )
	CurrentTab := ctrl
	if(MainObj.Tab[CurrentTab]="All")
		SetTimer, Hover, 60
	else
		SetTimer, Hover, Off
	SetImage( MainObj.GlossyPanelHwnd  , handle := Glossy( MainObj[MainObj.Tab[CurrentTab]].GlossyPanelUseGlossyCheckbox ) ) , DeleteObject( handle )
	For k, v in MainObj[MainObj.Tab[CurrentTab]]	
		GuiControl, 1:, % MainObj.Edits[k], % v	
	lock := 0
	guiControl,1:Focus, % MainObj.Edits.ButtonPanelTextEdit
	SendMessage, 0xB1, -2, -1,, % "ahk_id " MainObj.Edits.ButtonPanelTextEdit
	SetImage( Pichwnd , handle := CenterPanel( w , h , MainObj.Tab[CurrentTab] , MainObj[MainObj.Tab[CurrentTab]] , MainObj ) ) , DeleteObject( handle )
	return

GetEdits( ByRef Obj , CT ){
	For k , v in obj.Edits	{
		GuiControlGet, out, 1:, % v
		Obj[Obj.Tab[CT]][k] := "" Out
	}
}

SubmitEdit:
	if(lock)
		return
	GuiControlGet,hwnd,1: hwnd
	MainObj[MainObj.Tab[CurrentTab]][MainObj.EditHandles[hwnd]] := A_GuiControl
	return


AdjustSave:
	arr := ["Save PNG Set","Clipboard Button Object"]
	MouseGetPos,,,, ctrl3 , 2
	if( MainObj.DDLList[ ctrl3 ] = "Plus" ){
		if( ++MainObj.Count > arr.Length() )
			MainObj.Count := 1
	}else if( MainObj.DDLList[ ctrl3 ] = "Minus" ){
		if( --MainObj.Count < 1 )
			MainObj.Count := arr.Length()
	}
	SetImage( MainObj.DropDown , handle := DropDown( arr[ MainObj.Count ]) ) , DeleteObject( handle )
	arr := ""
	return

AddDropDown( Obj ){
	obj.DDLList := []
	Gui, 1:Add, Pic, x720 y46 w300 h26 0xE BackgroundTrans hwndhwnd
	obj.DropDown := hwnd
	Gui, 1:Add, Text, x730 y46 w30 h26 BackgroundTrans gAdjustSave hwndhwnd ;Border
	obj.DDLList[hwnd] := "Minus"
	Gui, 1:Add, Text, x980 y46 w30 h26 BackgroundTrans gAdjustSave hwndhwnd ;Border
	obj.DDLList[hwnd] := "Plus"
	SetImage( obj.DropDown , handle := DropDown() ) , DeleteObject( handle )
	Gui, 1:Add, Pic, x1025 y46 w100 h30 0xE BackgroundTrans hwndhwnd gExport
	obj.GB := hwnd
	SetImage( obj.GB , handle := GB() ) , DeleteObject( handle )
}

GB( Text := "GO" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( w:=60 , h:=30 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , w + 2 , h + 2 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , w , h , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 3 , 3 , w - 7 , h - 7 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 3 , 3 , w - 7  , h + 5 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) 
	Gdip_DrawRectangle( G , Pen , 3 , 3 , w - 7  , h - 7 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , w , h , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , Text , "s12 Center vCenter Bold c" Brush " x4 y4" , "Segoe ui" , w - 7 , h - 7 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

DropDown( Input := "Save PNG Set" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 300 , 26 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 30 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF02060a" ) , Gdip_FillRectangle( G , Brush , 11 , 3 , 28 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 14 , 4 , 23 , 18 , "0x77006666" , "0xaa002222" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 12 , 4 , 26 , 18 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF02060a" ) , Gdip_FillPie( G , Brush , 1 , 3 , 20 , 20 , 90 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 2 , 4 , 9 , 19 , "0x77006666" , "0xaa002222" , 1 , 1 ) , Gdip_FillPie( G , Brush , 2 , 4 , 18 , 18 , 90 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 19 , 9 , 13 , 8 , "0xFF009999" , "0xFF02060a" , 1 , 1 ) , Gdip_FillPolygon( G , Brush , "17,13|31,8|31,18|17,13|" ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 19 , 9 , 11 , 10 , "0xFF22262a" , "0xFF02060A" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawLines( G , Pen , "17,13|31,8|31,18|17,13|" ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF02060A" ) , Gdip_FillRectangle( G , Brush , 39 , 3 , 225 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 40 , 4 , 218 , 17 , "0x77006666" , "0xaa002222" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 39 , 4 , 222 , 18 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF02060a" ) , Gdip_FillRectangle( G , Brush , 260 , 3 , 28 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 260 , 3 , 27 , 22 , "0x77006666" , "0xaa002222" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 261 , 4 , 26 , 18 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF02060A" ) , Gdip_FillPie( G , Brush , 278 , 3 , 20 , 20 , 270 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 287 , 3 , 9 , 18 , "0x77006666" , "0xaa002222" , 1 , 1 ) , Gdip_FillPie( G , Brush , 279 , 4 , 18 , 18 , 270 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 269 , 8 , 14 , 9 , "0xFF009999" , "0xFF02060a" , 1 , 1 ) , Gdip_FillPolygon( G , Brush , "283,13|269,8|269,18|283,13|" ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 269 , 8 , 11 , 9 , "0xFF22262a" , "0xFF02060a" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawLines( G , Pen , "283,13|269,8|269,18|283,13|" ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 41 , 5 , 217 , 21 , "0xFFF0F0F0" , "0xFF009999" , 1 , 1 ) , Gdip_TextToGraphics( G , Input , "s16 Center vCenter Bold c" Brush " x40 y5" , "Segoe UI" , 219 , 18 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

TAG(obj){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 200 , 200 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	;~ Brush := Gdip_CreateLineBrushFromRect( 1 , 1 , 199 , 197 , "0xFF52565a" , "0xFF22262a" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 10 , 10 , 180 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 1 , 1 , 199 , 197 , "0xFF52565a" , "0xFF02060a" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 10 , 10 , 180 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 26 , 36 , 100 , 25 , "0x6632363a" , "0x6622262a" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 10 , 10 , 180 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrush( 26 , 65 , 34 , 153 , "0x6652565a" , "0x6622262a" , 1 ) , Gdip_FillEllipse( G , Brush , 10 , 10 , 180 , 180 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , 202 , 197 , "0xFFF0F0F0" , "0xFF000000" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawEllipse( G , Pen , 10 , 10 , 180 , 180 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "HB" , "s112 Center vCenter Bold c" Brush " x-2 y78" , "Segoe ui" , 200 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF62666a" ) , Gdip_TextToGraphics( G , "HB" , "s112 Center vCenter Bold c" Brush " x2 y82" , "Segoe ui" , 200 , 50 ) , Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrush( 43 , 59 , 65 , 126 , "0xFF004444" , "0xFF000000" , 1 ) , Gdip_TextToGraphics( G , "HB" , "s112 Center vCenter Bold c" Brush " x0 y80" , "Segoe ui" , 200 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrush( 43 , 59 , 65 , 126 , "0xFF" Obj.ALL.ButtonPanelBackgroundColorEdit , "0xFF000000" , 1 ) , Gdip_TextToGraphics( G , "HB" , "s112 Center vCenter Bold c" Brush " x0 y80" , "Segoe ui" , 200 , 50 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

_CreatePressedBitmap( W , H , Obj ){
		
	local arr := []
	;@	
	pBitmap := Gdip_CreateBitmap( W , H ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	;@
	Brush := Gdip_BrushCreateSolid( "0xFF" obj.ButtonPanelBackgroundColorEdit ) , Gdip_FillRectangle( G , Brush , -1 , -1 , W + 2 , H + 2 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_BrushCreateSolid( "0x" . obj.ButtonColorPanelOuterBorderColorAlphaEdit . obj.ButtonColorPanelOuterBorderColorEdit ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , W - 7 , H - 7 , 5 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , W , H , "0x" . obj.ButtonColorPanelInnerBorderColor1AlphaEdit . obj.ButtonColorPanelInnerBorderColor1Edit , "0x" . obj.ButtonColorPanelInnerBorderColor2AlphaEdit . obj.ButtonColorPanelInnerBorderColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , W - 5 , H - 8 , 5 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , W - 7 , H - 10 , "0x" . obj.ButtonColorPanelMainColor1AlphaEdit . obj.ButtonColorPanelMainColor1Edit , "0x" . obj.ButtonColorPanelMainColor2AlphaEdit . obj.ButtonColorPanelMainColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 5 , W - 11 , H - 12 , 5 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . obj.TextColorPanelBottomColor1AlphaEdit . obj.TextColorPanelBottomColor1Edit , "0x" . obj.TextColorPanelBottomColor2AlphaEdit . obj.TextColorPanelBottomColor2Edit , 1 , 1 )
		
	arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
		
	Loop, % 8
		;@
		Gdip_TextToGraphics( G , obj.ButtonPanelTextEdit , "s" obj.FontPanelFontSizeEdit " " obj.FontPanelFontOptionsEdit " c" Brush " x" 1 + arr[A_Index].X + Obj.FontPanelXOffsetEdit " y" 3 + arr[A_Index].Y + Obj.FontPanelYOffsetEdit , Obj.FontPanelFontEdit , W + Obj.FontPanelWOffsetEdit , H + Obj.FontPanelHOffsetEdit )
	Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . obj.TextColorPanelTopColor1AlphaEdit . obj.TextColorPanelTopColor1Edit , "0x" . obj.TextColorPanelTopColor2AlphaEdit . obj.TextColorPanelTopColor2Edit , 1 , 1 )
	;@	
	Gdip_TextToGraphics( G , obj.ButtonPanelTextEdit , "s" obj.FontPanelFontSizeEdit " " obj.FontPanelFontOptionsEdit " c" Brush " x" 1 + Obj.FontPanelXOffsetEdit " y" 3 + Obj.FontPanelYOffsetEdit , Obj.FontPanelFontEdit , W + Obj.FontPanelWOffsetEdit , H + Obj.FontPanelHOffsetEdit )
	Gdip_DeleteBrush( Brush )
	;@
	if( Obj.GlossyPanelUseGlossyCheckbox ){
		;@	
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelTopColorAlphaEdit . obj.GlossyPanelTopColorEdit ) , Gdip_FillRectangle( G , Brush , 5 , 10 , W - 11 , ( H / 2 ) - 10   ) , Gdip_DeleteBrush( Brush )
		;@
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelAccentColorAlphaEdit . obj.GlossyPanelAccentColorEdit ) , Gdip_FillRectangle( G , Brush , 10 , 12 , W - 21 , H / 15 ) , Gdip_DeleteBrush( Brush )
		;@	
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelBottomColorAlphaEdit . obj.GlossyPanelBottomColorEdit ) , Gdip_FillRectangle( G , Brush , 5  , 10 + ( H / 2 ) - 10 , W - 11 , ( H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
					
	}

	Gdip_DeleteGraphics( G )
		
	return pBitmap
}
	
_CreateHoverBitmap( W , H , Obj ){
		
	local arr := [] 
	if( W = null )
		W := 100
	if( H = null )
		H := 40
	
	;@
	pBitmap := Gdip_CreateBitmap( W , H ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	;@	
	Brush := Gdip_BrushCreateSolid( "0xFF" obj.ButtonPanelBackgroundColorEdit ) , Gdip_FillRectangle( G , Brush , -1 , -1 , W + 2 , H + 2 ) , Gdip_DeleteBrush( Brush )
	;@		
	Brush := Gdip_BrushCreateSolid( "0x" . obj.ButtonColorPanelOuterBorderColorAlphaEdit . obj.ButtonColorPanelOuterBorderColorEdit ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , W - 5 , H - 7 , 5 ) , Gdip_DeleteBrush( Brush )
	;@	
	Brush := Gdip_BrushCreateSolid( "0x" . obj.ButtonColorPanelCenterBorderColorAlphaEdit . obj.ButtonColorPanelCenterBorderColorEdit ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , W - 7 , H - 9 , 5 ) , Gdip_DeleteBrush( Brush )
	;@	
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , W , H-10 , "0x" . obj.ButtonColorPanelInnerBorderColor1AlphaEdit . obj.ButtonColorPanelInnerBorderColor1Edit , "0x" . obj.ButtonColorPanelInnerBorderColor2AlphaEdit . obj.ButtonColorPanelInnerBorderColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , W - 9 , H - 11 , 5 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 5 , 7 , W-11 , H-14 , "0x" . obj.ButtonColorPanelMainColor1AlphaEdit . obj.ButtonColorPanelMainColor1Edit , "0x" . obj.ButtonColorPanelMainColor2AlphaEdit . obj.ButtonColorPanelMainColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 7 , W - 11 , H - 14 , 5 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . obj.TextColorPanelBottomColor1AlphaEdit . obj.TextColorPanelBottomColor1Edit , "0x" . obj.TextColorPanelBottomColor2AlphaEdit . obj.TextColorPanelBottomColor2Edit , 1 , 1 )
		
	arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
		
	Loop, % 8
		;@	
		Gdip_TextToGraphics( G , obj.ButtonPanelTextEdit , "s" obj.FontPanelFontSizeEdit " " obj.FontPanelFontOptionsEdit " c" Brush " x" 0 + arr[A_Index].X + obj.FontPanelXOffsetEdit " y" 2 + arr[A_Index].Y + obj.FontPanelYOffsetEdit , obj.FontPanelFontEdit , W + obj.FontPanelWOffsetEdit , H + obj.FontPanelHOffsetEdit )
	;@
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . obj.TextColorPanelTopColor1AlphaEdit . obj.TextColorPanelTopColor1Edit , "0x" . obj.TextColorPanelTopColor2AlphaEdit . obj.TextColorPanelTopColor2Edit , 1 , 1 )
	;@	
	Gdip_TextToGraphics( G , obj.ButtonPanelTextEdit , "s" obj.FontPanelFontSizeEdit " " obj.FontPanelFontOptionsEdit " c" Brush " x" 0 + obj.FontPanelXOffsetEdit " y" 2 + obj.FontPanelYOffsetEdit , obj.FontPanelFontEdit , W + obj.FontPanelWOffsetEdit , H + obj.FontPanelHOffsetEdit )
	;@
	if( obj.GlossyPanelUseGlossyCheckbox = 1 ){
		;@	
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelTopColorAlphaEdit . obj.GlossyPanelTopColorEdit ) , Gdip_FillRectangle( G , Brush , 6 , 10 , W-13 , ( H / 2 ) - 10   ) , Gdip_DeleteBrush( Brush )
		;@	
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelAccentColorAlphaEdit . obj.GlossyPanelAccentColorEdit ) , Gdip_FillRectangle( G , Brush , 10 , 12 , W - 21 , H / 15 ) , Gdip_DeleteBrush( Brush )
		;@	
		Brush := Gdip_BrushCreateSolid( "0x" . obj.GlossyPanelBottomColorAlphaEdit . obj.GlossyPanelBottomColorEdit ) , Gdip_FillRectangle( G , Brush , 6  , 10 + ( H / 2 ) - 10 , W - 13 , ( H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
					
	}
	
	Gdip_DeleteGraphics( G )
		
	return pBitmap
		
}

_CreateDefaultBitmap( W , H , Obj ){
		
	local arr := [] 
	if( W = null )
		W := 100
	if( H = null )
		H := 40
	
	;@	
	pBitmap := Gdip_CreateBitmap( W , H ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	;@
	Brush := Gdip_BrushCreateSolid( "0xFF" Obj.ButtonPanelBackgroundColorEdit ) , Gdip_FillRectangle( G , Brush , -1 , -1 , W + 2 , H + 2 ) , Gdip_DeleteBrush( Brush )
	;@
	Brush := Gdip_BrushCreateSolid( "0x" . Obj.ButtonColorPanelOuterBorderColorAlphaEdit .  Obj.ButtonColorPanelOuterBorderColorEdit ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , W - 5 , H - 7 , 5 ) , Gdip_DeleteBrush( Brush )
	;@	
	Brush := Gdip_BrushCreateSolid( "0x" . Obj.ButtonColorPanelCenterBorderColorAlphaEdit . Obj.ButtonColorPanelCenterBorderColorEdit ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , W - 7 , H - 9 , 5 ) , Gdip_DeleteBrush( Brush )
	;@	
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , W , H - 10 , "0x" . Obj.ButtonColorPanelInnerBorderColor1AlphaEdit . Obj.ButtonColorPanelInnerBorderColor1Edit , "0x" . Obj.ButtonColorPanelInnerBorderColor2AlphaEdit . Obj.ButtonColorPanelInnerBorderColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , W - 9 , H - 11 , 5 ) , Gdip_DeleteBrush( Brush )
	;@	
	Brush := Gdip_CreateLineBrushFromRect( 5 , 7 , W - 11 , H - 14 , "0x" . Obj.ButtonColorPanelMainColor1AlphaEdit . Obj.ButtonColorPanelMainColor1Edit , "0x" . Obj.ButtonColorPanelMainColor2AlphaEdit . Obj.ButtonColorPanelMainColor2Edit , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 7 , W - 11 , H - 14 , 5 ) , Gdip_DeleteBrush( Brush )
	;@		
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . Obj.TextColorPanelBottomColor1AlphaEdit . Obj.TextColorPanelBottomColor1Edit , "0x" . Obj.TextColorPanelBottomColor2AlphaEdit . Obj.TextColorPanelBottomColor2Edit , 1 , 1 )
		
	arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
		
	Loop, % 8
		;@		
		Gdip_TextToGraphics( G , Obj.ButtonPanelTextEdit , "s" Obj.FontPanelFontSizeEdit " " Obj.FontPanelFontOptionsEdit " c" Brush " x" 0 + arr[A_Index].X + Obj.FontPanelXOffsetEdit " y" 2 + arr[A_Index].Y + Obj.FontPanelYOffsetEdit , Obj.FontPanelFontEdit , W + Obj.FontPanelWOffsetEdit , H + Obj.FontPanelHOffsetEdit )
	;@	
	Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , W , H , "0x" . Obj.TextColorPanelTopColor1AlphaEdit . Obj.TextColorPanelTopColor1Edit , "0x" . Obj.TextColorPanelTopColor2AlphaEdit . Obj.TextColorPanelTopColor2Edit , 1 , 1 )
	;@	
	Gdip_TextToGraphics( G , Obj.ButtonPanelTextEdit , "s" Obj.FontPanelFontSizeEdit " " Obj.FontPanelFontOptionsEdit " c" Brush " x" 0 + Obj.FontPanelXOffsetEdit " y" 2 + Obj.FontPanelYOffsetEdit , Obj.FontPanelFontEdit , W + Obj.FontPanelWOffsetEdit , H + Obj.FontPanelHOffsetEdit )
	;@
	if( Obj.GlossyPanelUseGlossyCheckbox ){
		
		Brush := Gdip_BrushCreateSolid( "0x" . Obj.GlossyPanelTopColorAlphaEdit . Obj.GlossyPanelTopColorEdit ) , Gdip_FillRectangle( G , Brush , 6 , 10 , W - 13 , ( H / 2 ) - 10   ) , Gdip_DeleteBrush( Brush )
			
		Brush := Gdip_BrushCreateSolid( "0x" . Obj.GlossyPanelAccentColorAlphaEdit . Obj.GlossyPanelAccentColorEdit ) , Gdip_FillRectangle( G , Brush , 10 , 12 , W - 21 , H / 15 ) , Gdip_DeleteBrush( Brush )
			
		Brush := Gdip_BrushCreateSolid( "0x" . Obj.GlossyPanelBottomColorAlphaEdit . Obj.GlossyPanelBottomColorEdit ) , Gdip_FillRectangle( G , Brush , 6  , 10 + ( H / 2 ) - 10 , W - 13 , ( H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
				
	}
	
	Gdip_DeleteGraphics( G )
	
	return pBitmap
		
}

SetDisplayWindow( obj ){
	DisplayMasterBitmap := Gdip_CreateBitmap( 640 , 85 ) , G := Gdip_GraphicsFromImage( DisplayMasterBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" . Obj.ALL.ButtonPanelBackgroundColorEdit  ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 642 , 87   ) , Gdip_DeleteBrush( Brush )
	DisplayDefaultBitmap := _CreateDefaultBitmap( 200 , 65 , obj.Default )
	DisplayHoverBitmap := _CreateHoverBitmap( 200 , 65 , obj.Hover )
	DisplayPressedBitmap := _CreatePressedBitmap( 200 , 65 , obj.Pressed )
	Gdip_DrawImage(G, DisplayDefaultBitmap , 10 , 10 , 200 , 65 ) , Gdip_DisposeImage( DisplayDefaultBitmap )
	Gdip_DrawImage(G, DisplayHoverBitmap , 220 , 10 , 200 , 65 ) , Gdip_DisposeImage( DisplayHoverBitmap )
	Gdip_DrawImage(G, DisplayPressedBitmap , 430 , 10 , 200 , 65 ) , Gdip_DisposeImage( DisplayPressedBitmap )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( DisplayMasterBitmap )
	Gdip_DisposeImage( DisplayMasterBitmap )
	SetImage( DisplayHwnd , hBitmap )	
	DeleteObject( hBitmap )
}

AddControlPanel( obj ){
	local hwnd
	Gui,1:Add,Pic,x982 y480 w80 h24 0xE hwndhwnd gAutoUpdate
	obj.AutoSwitch := Hwnd
	obj.AutoSwitchState := 0
	SetImage( obj.AutoSwitch , handle := AutoSwitchOff() ) , DeleteObject( handle )
	Gui, 1:Add, Text,cTeal x980 y515 w80 h30  BackgroundTrans center 0x200 gUpdateButton, 
	Gui, 1:Add, Pic, x325 y470 w640 h85  HwndDisplayHwnd 0xE
	SetDisplayWindow(obj)
}

AutoSwitchOn(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 80 , 24 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF171717" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 143 , 28 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000808" ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , 32 , 16 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF002222" ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , 30 , 14 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 8 , 30 , 11 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000808" ) , Gdip_FillEllipse( G , Brush , 17 , 0 , 22 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 5 , 0 , 24 , 20 , "0xff004444" , "0xff02060a" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 18 , 1 , 20 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 1 , 1 , 135 , 21 , "0xFF009999" , "0xFF004444" , 1 , 1 ) , Gdip_TextToGraphics( G , "Auto" , "s12 Center vCenter Bold NoWrap c" Brush " x14 y1" , "Segoe ui" , 90 , 24 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

AutoSwitchOff(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 80 , 24 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF171717" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 143 , 28 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000808" ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , 32 , 16 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , 30 , 14 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 8 , 30 , 11 , 5 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000808" ) , Gdip_FillEllipse( G , Brush , 1 , 0 , 22 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 5 , 0 , 24 , 20 , "0xff004444" , "0xff02060a" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 2 , 1 , 20 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 1 , 1 , 135 , 21 , "0xFF009999" , "0xFF004444" , 1 , 1 ) , Gdip_TextToGraphics( G , "Auto" , "s12 Center vCenter Bold NoWrap c" Brush " x14 y1" , "Segoe ui" , 90 , 24 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

AddTabsPanel( obj ){
	local hwnd , handle
	
	Gui, 1:Add, Pic, x16 y45 w343 h30 0xE hwndhwnd
	obj.TabsPanelHwnd := hwnd
	SetImage( hwnd , handle := Tabs("ALL") )
	DeleteObject( handle )
	;****************************************************************************************************
	
	;All Tab
	Gui, 1:Add, Text,cWhite x20 y50 w80 h20 BackgroundTrans hwndhwnd gSwitchTabs      ;Border
	Obj.Tab[hwnd] := "ALL"
	CurrentTab := hwnd
	
	;****************************************************************************************************
	
	;Default Tab
	Gui, 1:Add, Text,cWhite x105 y50 w80 h20 BackgroundTrans hwndhwnd gSwitchTabs      ;Border
	Obj.Tab[hwnd] := "Default"
	
	;****************************************************************************************************
	
	;Hover Tab
	Gui, 1:Add, Text,cWhite x190 y50 w80 h20 BackgroundTrans hwndhwnd gSwitchTabs      ;Border
	Obj.Tab[hwnd] := "Hover"
	
	;****************************************************************************************************
	
	;Pressed Tab
	Gui, 1:Add, Text,cWhite x275 y50 w80 h20 BackgroundTrans hwndhwnd gSwitchTabs      ;Border
	Obj.Tab[hwnd] := "Pressed"
	
}

AddButtonColorPanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x785 y245 w300 h220 0xE hwndhwnd
	obj.ButtonColorPanelHwnd := hwnd
	SetImage( hwnd , handle := ButtonColors() )
	DeleteObject( handle )
	;****************************************************************************************************
	
	;Outer Border Color Alpha
	Gui, 1:Add, Edit, cWhite x889 y283 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelOuterBorderColorAlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelOuterBorderColorAlphaEdit"
	
	;Outer Border Color
	Gui, 1:Add, Edit, cWhite x929 y283 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelOuterBorderColorEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelOuterBorderColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y280 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelOuterBorderColorEdit
	
	;****************************************************************************************************
	
	
	;Center Border Color Alpha
	Gui, 1:Add, Edit, cWhite x889 y313 w28 h18 -E0x200 Center hwndhwnd  Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelCenterBorderColorAlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelCenterBorderColorAlphaEdit"
	
	;Outer Border Color
	Gui, 1:Add, Edit, cWhite x929 y313 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelCenterBorderColorEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelCenterBorderColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y310 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelCenterBorderColorEdit
	
	;****************************************************************************************************
	
	
	;Inner Border Color 1 Alpha
	Gui, 1:Add, Edit, cWhite x889 y343 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelInnerBorderColor1AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelInnerBorderColor1AlphaEdit"
	
	;Inner Border Color 1
	Gui, 1:Add, Edit, cWhite x929 y343 w88 h18 -E0x200 Center hwndhwnd  Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelInnerBorderColor1Edit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelInnerBorderColor1Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y340 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelInnerBorderColor1Edit
	
	;****************************************************************************************************
	
	;Inner Border Color 2 Alpha
	Gui, 1:Add, Edit, cWhite x889 y373 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelInnerBorderColor2AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelInnerBorderColor2AlphaEdit"
	
	;Inner Border Color 2
	Gui, 1:Add, Edit, cWhite x929 y373 w88 h18 -E0x200 Center hwndhwnd  Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelInnerBorderColor2Edit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelInnerBorderColor2Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y370 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelInnerBorderColor2Edit
	
	;****************************************************************************************************
	
	;Main Color 1 Alpha
	Gui, 1:Add, Edit, cWhite x889 y403 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelMainColor1AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelMainColor1AlphaEdit"
	
	;Main Color 1
	Gui, 1:Add, Edit, cWhite x929 y403 w88 h18 -E0x200 Center hwndhwnd  Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelMainColor1Edit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelMainColor1Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y400 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelMainColor1Edit
	
	;****************************************************************************************************
	
	;Main Color 2 Alpha
	Gui, 1:Add, Edit, cWhite x889 y433 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.ButtonColorPanelMainColor2AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelMainColor2AlphaEdit"
	
	;Main Color 2
	Gui, 1:Add, Edit, cWhite x929 y433 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.ButtonColorPanelMainColor2Edit := hwnd
	Obj.EditHandles[hwnd] := "ButtonColorPanelMainColor2Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y430 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonColorPanelMainColor2Edit
	
	;****************************************************************************************************
	
	
}

AddGlossyPanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x785 y81 w300 h165 0xE hwndhwnd
	obj.GlossyPanelHwnd := hwnd
	SetImage( hwnd , handle := Glossy() )
	DeleteObject( handle )
	
	;****************************************************************************************************
	;Use Glossy Checkbox
	Gui, 1:Add, Text, x807 y118 w120 h20 BackgroundTrans gToggleGlossy
	
	;****************************************************************************************************
	
	;Top Color Alpha
	Gui, 1:Add, Edit, cWhite x889 y152 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.GlossyPanelTopColorAlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelTopColorAlphaEdit"
	
	;Top Color 
	Gui, 1:Add, Edit, cWhite x929 y152 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.GlossyPanelTopColorEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelTopColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y148 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.GlossyPanelTopColorEdit
	
	;****************************************************************************************************
	
	
	
	;Bottom Color Alpha
	Gui, 1:Add, Edit, cWhite x889 y182 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.GlossyPanelBottomColorAlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelBottomColorAlphaEdit"
	
	;Bottom Color 
	Gui, 1:Add, Edit, cWhite x929 y182 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.GlossyPanelBottomColorEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelBottomColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y178 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.GlossyPanelBottomColorEdit
	
	;****************************************************************************************************
	
	;Accent Color Alpha
	Gui, 1:Add, Edit, cWhite x889 y212 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.GlossyPanelAccentColorAlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelAccentColorAlphaEdit"
	
	;Accent Color 
	Gui, 1:Add, Edit, cWhite x929 y212 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.GlossyPanelAccentColorEdit := hwnd
	Obj.EditHandles[hwnd] := "GlossyPanelAccentColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x1022 y208 w49 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.GlossyPanelAccentColorEdit
	
	;****************************************************************************************************
	
}

AddTextColorPanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x16 y410 w300 h200 0xE hwndhwnd
	obj.TextColorPanelHwnd := hwnd
	SetImage( hwnd , handle := FontColor() )
	DeleteObject( handle )
	;****************************************************************************************************
	
	;Top Color 1 Alpha
	Gui, 1:Add, Edit, cWhite x120 y445 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.TextColorPanelTopColor1AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelTopColor1AlphaEdit"
	
	;Top Color 1 
	Gui, 1:Add, Edit, cWhite x160 y445 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.TextColorPanelTopColor1Edit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelTopColor1Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x253 y442 w48 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.TextColorPanelTopColor1Edit
	
	;****************************************************************************************************
	
	;Top Color 2 Alpha
	Gui, 1:Add, Edit, cWhite x120 y475 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.TextColorPanelTopColor2AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelTopColor2AlphaEdit"
	
	;Top Color 2 
	Gui, 1:Add, Edit, cWhite x160 y475 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.TextColorPanelTopColor2Edit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelTopColor2Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x253 y472 w48 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.TextColorPanelTopColor2Edit
	
	;****************************************************************************************************
	
	;Bottom Color 1 Alpha
	Gui, 1:Add, Edit, cWhite x120 y505 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.TextColorPanelBottomColor1AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelBottomColor1AlphaEdit"
	
	;Bottom Color 1 
	Gui, 1:Add, Edit, cWhite x160 y505 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.TextColorPanelBottomColor1Edit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelBottomColor1Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x253 y502 w48 h24 BackgroundTrans hwndhwnd gGetColor 
	Obj.ButtonHandles[hwnd] := Obj.Edits.TextColorPanelBottomColor1Edit
	
	;****************************************************************************************************
	
	;Bottom Color 2 Alpha
	Gui, 1:Add, Edit, cWhite x120 y535 w28 h18 -E0x200 Center hwndhwnd Limit2 gSubmitEdit
	Obj.Edits.TextColorPanelBottomColor2AlphaEdit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelBottomColor2AlphaEdit"
	
	;Bottom Color 2
	Gui, 1:Add, Edit, cWhite x160 y535 w88 h18 -E0x200 Center hwndhwnd Limit6 gSubmitEdit
	Obj.Edits.TextColorPanelBottomColor2Edit := hwnd
	Obj.EditHandles[hwnd] := "TextColorPanelBottomColor2Edit"
	
	;Button
	Gui, 1:Add, Text,cWhite x253 y532 w48 h24 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.TextColorPanelBottomColor2Edit
	
	;****************************************************************************************************
	
}

AddFontPanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x16 y215 w300 h200 0xE hwndhwnd
	obj.FontPanelHwnd := hwnd
	SetImage( hwnd , handle := FontOptions() )
	DeleteObject( handle )
	
	;Font Size
	Gui, 1:Add, Edit, cWhite x95 y250 w55 h18 -E0x200 Center Limit3 Number hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelFontSizeEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelFontSizeEdit"
	
	;Font 
	Gui, 1:Add, Edit, cWhite x70 y280 w225 h18 -E0x200 Center hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelFontEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelFontEdit"
	
	;Font Options
	Gui, 1:Add, Edit, cWhite x117 y310 w178 h18 -E0x200 Center hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelFontOptionsEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelFontOptionsEdit"
	
	;X Offset
	Gui, 1:Add, Edit, cWhite x87 y340 w70 h18 -E0x200 Center Limit4 hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelXOffsetEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelXOffsetEdit"
	
	;Y Offset
	Gui, 1:Add, Edit, cWhite x217 y340 w70 h18 -E0x200 Center Limit4 hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelYOffsetEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelYOffsetEdit"
	
	;W Offset
	Gui, 1:Add, Edit, cWhite x93 y370 w65 h18 -E0x200 Center Limit4 hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelWOffsetEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelWOffsetEdit"
	
	;H Offset
	Gui, 1:Add, Edit, cWhite x223 y370 w65 h18 -E0x200 Center Limit4 hwndhwnd gSubmitEdit
	Obj.Edits.FontPanelHOffsetEdit := hwnd
	Obj.EditHandles[hwnd] := "FontPanelHOffsetEdit"
	
}

AddButtonOptionsPanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x16 y81 w300 h140 0xE hwndhwnd
	obj.ButtonOptionsPanelHwnd := hwnd
	SetImage( hwnd , handle := ButtonOptions() )
	DeleteObject( handle )
	;text
	Gui, 1:Add, Edit,cWhite x113 y119 w179 h18 -E0x200 Center hwndhwnd gSubmitEdit
	Obj.Edits.ButtonPanelTextEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonPanelTextEdit"
	
	;width
	Gui, 1:Add, Edit,cWhite x117 y148 w43 h18 -E0x200 Center Limit4 Number hwndhwnd gSubmitEdit
	Obj.Edits.ButtonPanelWidthEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonPanelWidthEdit"
	
	;height
	Gui, 1:Add, Edit,cWhite x255 y148 w43 h18 -E0x200 Center Limit4 Number hwndhwnd gSubmitEdit
	Obj.Edits.ButtonPanelHeightEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonPanelHeightEdit"
	
	;Background Color
	Gui, 1:Add, Edit,cWhite x142 y179 w111 h18 -E0x200 Center Limit6 hwndhwnd gSubmitEdit
	Obj.Edits.ButtonPanelBackgroundColorEdit := hwnd
	Obj.EditHandles[hwnd] := "ButtonPanelBackgroundColorEdit"
	
	;Button
	Gui, 1:Add, Text,cWhite x262 y177 w36 h21 BackgroundTrans hwndhwnd gGetColor
	Obj.ButtonHandles[hwnd] := Obj.Edits.ButtonPanelBackgroundColorEdit
	
}

CenterPanel( w , h , tab , obj , main ){
	pBitmap := Gdip_CreateBitmap( w , h ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Obj.ButtonPanelBackgroundColorEdit ) , Gdip_FillRectangle( G , Brush , -1 , -1 , w+2 , h+2 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 0 , 0 , w-1 , h-1 ) , Gdip_DeletePen( Pen )
	
	if(isPressed){
		Gdip_DrawImage(G, HBBitmap := TAG(main) , ( w / 2 ) - ( 200 / 2 ) , 20 , 200 , 200 ) , Gdip_DisposeImage( HBBitmap )
		Gdip_DrawImage(G, HBBitmap := _CreatePressedBitmap( main.Pressed.ButtonPanelWidthEdit , main.Pressed.ButtonPanelHeightEdit , main.Pressed ) , ( w / 2 ) - ( main.Pressed.ButtonPanelWidthEdit / 2 ) , 230 , main.Pressed.ButtonPanelWidthEdit, main.Pressed.ButtonPanelHeightEdit ) , Gdip_DisposeImage( HBBitmap )
		
	}else if(Active){
		Gdip_DrawImage(G, HBBitmap := TAG(main) , ( w / 2 ) - ( 200 / 2 ) , 20 , 200 , 200 ) , Gdip_DisposeImage( HBBitmap )
		Gdip_DrawImage(G, HBBitmap := _CreateHoverBitmap( main.Hover.ButtonPanelWidthEdit , main.Hover.ButtonPanelHeightEdit , main.Hover ) , ( w / 2 ) - ( main.Hover.ButtonPanelWidthEdit / 2 ) , 230 , main.Hover.ButtonPanelWidthEdit, main.Hover.ButtonPanelHeightEdit ) , Gdip_DisposeImage( HBBitmap )
		
	}else if(tab="All"){
		GuiControl, 1: Move , % DemoHwnd, % "x" ( w / 2 ) - ( main.Default.ButtonPanelWidthEdit / 2 ) + 320 " y" 230 + 95 " w" main.Default.ButtonPanelWidthEdit " h" main.Default.ButtonPanelHeightEdit
		
		Gdip_DrawImage(G, HBBitmap := TAG(main) , ( w / 2 ) - ( 200 / 2 ) , 20 , 200 , 200 ) , Gdip_DisposeImage( HBBitmap )
		Gdip_DrawImage(G, HBBitmap := _CreateDefaultBitmap( main.Default.ButtonPanelWidthEdit , main.Default.ButtonPanelHeightEdit , main.Default ) , ( w / 2 ) - ( main.Default.ButtonPanelWidthEdit / 2 ) , 230 , main.Default.ButtonPanelWidthEdit, main.Default.ButtonPanelHeightEdit ) , Gdip_DisposeImage( HBBitmap )
		
	}else{
		GuiControl, 1: Move , % DemoHwnd, x0 y0 w0 h0
		Gdip_DrawImage(G, HBBitmap := _Create%Tab%Bitmap( Obj.ButtonPanelWidthEdit , Obj.ButtonPanelHeightEdit , Obj ) , ( w / 2 ) - ( Obj.ButtonPanelWidthEdit / 2 ) , ( h / 2 ) - ( Obj.ButtonPanelHeightEdit / 2 ) , Obj.ButtonPanelWidthEdit, Obj.ButtonPanelHeightEdit ) , Gdip_DisposeImage( HBBitmap )
	}
	
	
	;Extra
	;___________________________________
	Pen := Gdip_CreatePen( "0xFF121212" , 4 )
	;~ Pen := Gdip_CreatePen( "0xFFff0000" , 4 )
	;~ Gdip_DrawLine( G , Pen , 315 , 92 , 785 , 92 )
	;~ Gdip_DrawLine( G , Pen , 317 , 89 , 317 , 125 )
	 Gdip_DrawRoundedRectangle( G , Pen , 3 , 3 , 453 , 356 , 0 ) , Gdip_DeletePen( Pen )
	 Pen := Gdip_CreatePen( "0xFF004444" , 1 )
	 Gdip_DrawRoundedRectangle( G , Pen , 5 , 5 , 449 , 352 , 0 ) , Gdip_DeletePen( Pen )
	;x320 y95 w:=460 , h:= 363
	
	
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

Tabs( tab := "All" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 343 , 30 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 352 , 32 ) , Gdip_DeleteBrush( Brush )
	
	if(tab="All"){
		Brush := Gdip_CreateLineBrushFromRect( 4 , 5 , 79 , 18 , "0xFF006666" , "0xFF000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 2 , 3 , 80 , 22 , "0xFF008888" , "0xFF002222" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 3 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 5 , 78 , 20 , "0xFF006666" , "0xFFffffff" , 1 , 1 ) , Gdip_TextToGraphics( G , "ALL" , "s12 Center vCenter Bold c" Brush " x3 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	
		;Highlight
		Brush := Gdip_BrushCreateSolid( "0x11F0F0F0" ) , Gdip_FillRectangle( G , Brush , 5 , 7 , 75 , 8 ) , Gdip_DeleteBrush( Brush )
	
	
	}else{
		Brush := Gdip_CreateLineBrushFromRect( 3 , 5 , 80 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 3 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "All" , "s12 Center vCenter Bold c" Brush " x3 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	
	}
	
	if(tab="Default"){
		Brush := Gdip_CreateLineBrushFromRect( 88 , 5 , 80 , 20 , "0xFF006666" , "0xFF000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 88 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 88 , 5 , 80 , 20 , "0xFF008888" , "0xFF002222" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 88 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 88 , 5 , 80 , 20 , "0xFF006666" , "0xFFffffff" , 1 , 1 ) , Gdip_TextToGraphics( G , "DEFAULT" , "s12 Center vCenter Bold c" Brush " x88 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
		;Highlight
		Brush := Gdip_BrushCreateSolid( "0x11F0F0F0" ) , Gdip_FillRectangle( G , Brush , 90 , 7 , 75 , 8 ) , Gdip_DeleteBrush( Brush )
		
	}else{
		
		Brush := Gdip_CreateLineBrushFromRect( 88 , 5 , 80 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 88 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 88 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "Default" , "s12 Center vCenter Bold c" Brush " x88 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	
	}
	if(tab="Hover"){
		Brush := Gdip_CreateLineBrushFromRect( 173 , 5 , 80 , 20 , "0xFF006666" , "0xFF000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 173 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 173 , 5 , 80 , 20 , "0xFF008888" , "0xFF002222" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 173 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 173 , 5 , 80 , 20 , "0xFF006666" , "0xFFffffff" , 1 , 1 ) , Gdip_TextToGraphics( G , "HOVER" , "s12 Center vCenter Bold c" Brush " x173 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
		;Highlight
		Brush := Gdip_BrushCreateSolid( "0x11F0F0F0" ) , Gdip_FillRectangle( G , Brush , 175 , 7 , 75 , 8 ) , Gdip_DeleteBrush( Brush )
		
	}else{
		
		Brush := Gdip_CreateLineBrushFromRect( 89 , 5 , 77 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 173 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 173 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "Hover" , "s12 Center vCenter Bold c" Brush " x173 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	
	}
	
	if(tab="Pressed"){
		Brush := Gdip_CreateLineBrushFromRect( 258 , 5 , 80 , 20 , "0xFF006666" , "0xFF000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 258 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 258 , 5 , 80 , 20 , "0xFF008888" , "0xFF002222" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 258 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 258 , 5 , 80 , 20 , "0xFF006666" , "0xFFffffff" , 1 , 1 ) , Gdip_TextToGraphics( G , "PRESSED" , "s12 Center vCenter Bold c" Brush " x258 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
		;Highlight
		Brush := Gdip_BrushCreateSolid( "0x11F0F0F0" ) , Gdip_FillRectangle( G , Brush , 260 , 7 , 75 , 8 ) , Gdip_DeleteBrush( Brush )
		
	}else{
		
		Brush := Gdip_CreateLineBrushFromRect( 89 , 5 , 77 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 258 , 5 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 258 , 5 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "Pressed" , "s12 Center vCenter Bold c" Brush " x258 y6" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
		
	}
	
	
	
	;~ ;Highlight
	;~ Brush := Gdip_BrushCreateSolid( "0x11F0F0F0" ) , Gdip_FillRectangle( G , Brush , 5 , 7 , 75 , 8 ) , Gdip_DeleteBrush( Brush )
	
	
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

ButtonColors(){
	local BackgroundColor := "0xFF171717" , HeaderColor := "0xFF071414"
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 300 , 220 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 222 ) , Gdip_DeleteBrush( Brush )
	
	
	Brush := Gdip_BrushCreateSolid( BackgroundColor ) , Gdip_FillRectangle( G , Brush , 10 , 15 , 280 , 198 ) , Gdip_DeleteBrush( Brush )
	
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 10 , 15 , 280 , 198 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( HeaderColor ) , Gdip_FillRectangle( G , Brush , 15 , 5 , 138 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 15 , 8 , 96 , 17 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Button Colors" , "s12  Bold c" Brush " x42 y8" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 15 , 5 , 138 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Outer Border:" , "s12 c" Brush " x16 y38" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 35 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 35 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 35 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 35 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 34 , 49 , 24 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 34 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 35 , 51 , 49 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 34 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 15 , 8 , 96 , 17 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y38" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Center Border:" , "s12 c" Brush " x16 y68" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 65 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 65 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 65 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 65 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 63 , 47 , 25 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 64 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 61 , 51 , 49 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 64 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 66 , 49 , 20 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y68" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Inner Border 1:" , "s12 c" Brush " x16 y98" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 95 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 95 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 95 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 95 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 94 , 47 , 24 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 94 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 94 , 50 , 40 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 94 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 94 , 47 , 24 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y98" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Inner Border 2:" , "s12 c" Brush " x16 y128" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 125 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 125 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 125 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 125 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 124 , 47 , 23 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 124 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 124 , 47 , 43 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 124 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 128 , 48 , 21 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y128" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Main 1:" , "s12 c" Brush " x16 y158" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 155 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 155 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 155 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 155 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 154 , 50 , 21 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 154 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 153 , 52 , 42 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 154 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 154 , 48 , 23 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y158" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Main 2:" , "s12 c" Brush " x16 y188" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 185 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 185 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 185 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 185 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 184 , 48 , 24 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 184 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 182 , 51 , 51 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 184 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 154 , 48 , 23 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x249 y188" , "Segoe ui" , 122 , 22 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}
	
Glossy( input := 0 ){
	local BackgroundColor := "0xFF171717" , HeaderColor := "0xFF071414"
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 300 , 165 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 172 ) , Gdip_DeleteBrush( Brush )
	
	Brush := Gdip_BrushCreateSolid( BackgroundColor ) , Gdip_FillRectangle( G , Brush , 10 , 15 , 280 , 145 ) , Gdip_DeleteBrush( Brush )
	
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 10 , 15 , 280 , 145 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( HeaderColor ) , Gdip_FillRectangle( G , Brush , 15 , 6 , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 15 , 6 , 120 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 15 , 6 , 120 , 21 , "0xFF00aaaa" , "0xFF004444" , 1 , 1 ) , Gdip_TextToGraphics( G , "Glossy" , "s12 Center vCenter Bold c" Brush " x15 y6" , "Segoe ui" , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	;Use Glossy Checkbox
	Brush := Gdip_BrushCreateSolid( BackgroundColor ) , Gdip_FillRectangle( G , Brush , 18 , 38 , 122 , 19 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 21 , 41 , 13 , 13 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( (input=1)?("0xFF008888"):("0xFF003333") ) , Gdip_FillRectangle( G , Brush , 24 , 44 , 7 , 7 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Use Glossy Effect" , "s12 c" Brush " x41 y40" , "Segoe ui" , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Top Color:" , "s12 c" Brush " x16 y70" , "Segoe ui" , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Btm Color:" , "s12 c" Brush " x16 y100" , "Segoe ui" , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Accent Color:" , "s12 c" Brush " x16 y130" , "Segoe ui" , 120 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 68 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 98 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 102 , 128 , 30 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 68 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 98 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 142 , 128 , 90 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 69 , 46 , 22 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 67 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 240 , 97 , 44 , 25 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 97 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 127 , 47 , 23 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 237 , 127 , 48 , 24 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 68 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 98 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 102 , 128 , 30 , 22 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 68 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 98 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 142 , 128 , 90 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 66 , 52 , 48 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 237 , 67 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 237 , 97 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 237 , 127 , 48 , 24 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 67 , 45 , 23 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12 Center vCenter Bold c" Brush " x236 y55" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 97 , 46 , 24 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12 Center vCenter Bold c" Brush " x236 y85" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 239 , 128 , 46 , 24 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12 Center vCenter Bold c" Brush " x236 y115" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

FontColor(){
	local BackgroundColor := "0xFF171717" , HeaderColor := "0xFF071414"
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 300 , 160 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ),Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 162 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( BackgroundColor ),Gdip_FillRectangle( G , Brush , 10 , 10 , 280 , 140 ),Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 10 , 10 , 280 , 140 ),Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( HeaderColor ),Gdip_FillRectangle( G , Brush , 15 , 3 , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 15 , 3 , 130 , 20 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 16 , 4 , 169 , 19 , "0xFF00aaaa" , "0xFF004444" , 1 , 1 ),Gdip_TextToGraphics( G , "Text Colors" , "s12 Center vCenter Bold c" Brush " x15 y4" , "Segoe ui" , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ),Gdip_TextToGraphics( G , "Top Color 1:" , "s12 c" Brush " x17 y34" , "Segoe ui" , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ),Gdip_TextToGraphics( G , "Top Color 2:" , "s12 c" Brush " x17 y64" , "Segoe ui" , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ),Gdip_TextToGraphics( G , "Btm Color 1:" , "s12 c" Brush " x17 y94" , "Segoe ui" , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ),Gdip_TextToGraphics( G , "Btm Color 2:" , "s12 c" Brush " x17 y124" , "Segoe ui" , 130 , 20 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 102 , 33 , 30 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 142 , 33 , 90 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 102 , 63 , 30 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 142 , 63 , 90 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 102 , 93 , 30 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 142 , 93 , 90 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 102 , 123 , 30 , 22 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ),Gdip_FillRectangle( G , Brush , 142 , 123 , 90 , 22 ),Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 102 , 33 , 30 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 142 , 33 , 90 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 102 , 63 , 30 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 142 , 63 , 90 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 102 , 93 , 30 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 102 , 123 , 30 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 142 , 93 , 90 , 22 ),Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ),Gdip_DrawRectangle( G , Pen , 142 , 123 , 90 , 22 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 34 , 45 , 24 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ),Gdip_FillRectangle( G , Brush , 237 , 32 , 47 , 24 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 238 , 32 , 49 , 38 , "0xFF006666" , "0xFF121212" , 1 , 1 ),Pen := Gdip_CreatePenFromBrush( Brush , 1 ),Gdip_DeleteBrush( Brush ),Gdip_DrawRectangle( G , Pen , 237 , 32 , 47 , 24 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 236 , 32 , 48 , 25 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ),Gdip_TextToGraphics( G , "Get" , "s12 Bold c" Brush " x248 y36" , "Segoe ui" , 70 , 50 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 239 , 62 , 43 , 22 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ),Gdip_FillRectangle( G , Brush , 237 , 62 , 47 , 24 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 240 , 62 , 48 , 40 , "0xFF006666" , "0xFF121212" , 1 , 1 ),Pen := Gdip_CreatePenFromBrush( Brush , 1 ),Gdip_DeleteBrush( Brush ),Gdip_DrawRectangle( G , Pen , 237 , 62 , 47 , 24 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 62 , 45 , 22 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ),Gdip_TextToGraphics( G , "Get" , "s12 Bold c" Brush " x248 y66" , "Segoe ui" , 70 , 50 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 93 , 45 , 22 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ),Gdip_FillRectangle( G , Brush , 237 , 92 , 47 , 24 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 90 , 49 , 38 , "0xFF006666" , "0xFF121212" , 1 , 1 ),Pen := Gdip_CreatePenFromBrush( Brush , 1 ),Gdip_DeleteBrush( Brush ),Gdip_DrawRectangle( G , Pen , 237 , 92 , 47 , 24 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 240 , 92 , 42 , 22 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ),Gdip_TextToGraphics( G , "Get" , "s12 Bold c" Brush " x248 y96" , "Segoe ui" , 70 , 50 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 237 , 120 , 45 , 26 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ),Gdip_FillRectangle( G , Brush , 237 , 122 , 47 , 24 ),Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 239 , 122 , 46 , 36 , "0xFF006666" , "0xFF121212" , 1 , 1 ),Pen := Gdip_CreatePenFromBrush( Brush , 1 ),Gdip_DeleteBrush( Brush ),Gdip_DrawRectangle( G , Pen , 237 , 122 , 47 , 24 ),Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 240 , 121 , 44 , 24 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ),Gdip_TextToGraphics( G , "Get" , "s12 Bold c" Brush " x248 y126" , "Segoe ui" , 70 , 50 ),Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

FontOptions(){
	local BackgroundColor := "0xFF171717" , HeaderColor := "0xFF071414"
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 300 , 200 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 202 ) , Gdip_DeleteBrush( Brush )
	
	
	
	Brush := Gdip_BrushCreateSolid( BackgroundColor ) , Gdip_FillRectangle( G , Brush , 10 , 15 , 280 , 175 ) , Gdip_DeleteBrush( Brush )
	
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 10 , 15 , 280 , 175 ) , Gdip_DeletePen( Pen )
	;~ Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , 15 , 10 , 136 , 10 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( HeaderColor ) , Gdip_FillRectangle( G , Brush , 15 , 5 , 136 , 20 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 15 , 5 , 136 , 20 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 18 , 7 , 135 , 17 , "0xFF00aaaa" , "0xFF004444" , 1 , 1 ) , Gdip_TextToGraphics( G , "Font & Font Options" , "s12 Bold c" Brush " x23 y6" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Font:" , "s12 c" Brush " x17 y66" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;Font Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 52 , 63 , 228 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 52 , 63 , 228 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Font Size:" , "s12 c" Brush " x17 y36" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;Font Size Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 77 , 33 , 58 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 76 , 33 , 59 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Font Options:" , "s12 c" Brush " x17 y96" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;Font Options Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 100 , 93 , 180 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 99 , 93 , 181 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "X Offset:" , "s12 c" Brush " x17 y126" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;X Offset Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 70 , 123 , 72 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 69 , 123 , 73 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Y Offset:" , "s12 c" Brush " x147 y126" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;Y Offset Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 200 , 123 , 72 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 199 , 123 , 73 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "W Offset:" , "s12 c" Brush " x17 y156" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;W Offset Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 75 , 153 , 67 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 75 , 153 , 68 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "H Offset:" , "s12 c" Brush " x147 y156" , "Segoe ui" , 140 , 50 ) , Gdip_DeleteBrush( Brush )
	;H Offset Edit
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 205 , 153 , 67 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 205 , 153 , 68 , 22 ) , Gdip_DeletePen( Pen )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

ButtonOptions(){
	;Bitmap Created Using: HB Bitmap Maker
	
	local BackgroundColor := "0xFF171717" , HeaderColor := "0xFF071414"
	
	pBitmap := Gdip_CreateBitmap( 300 , 140 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 142 ) , Gdip_DeleteBrush( Brush )
	
	
	
	
	Brush := Gdip_BrushCreateSolid( BackgroundColor ) , Gdip_FillRectangle( G , Brush , 10 , 15 , 280 , 115 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 10 , 15 , 280 , 115 ) , Gdip_DeletePen( Pen )
	
	
	;~ Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , 15 , 10 , 110 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( HeaderColor ) , Gdip_FillRectangle( G , Brush , 15 , 10 , 110 , 20 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 15 , 10 , 110 , 20 ) , Gdip_DeletePen( Pen )
	
	
	
	Brush := Gdip_CreateLineBrushFromRect( 15 , 11 , 110 , 20 , "0xFF00aaaa" , "0xFF004444" , 1 , 1 ) , Gdip_TextToGraphics( G , "Button Options" , "s12 Bold Center vCenter c" Brush " x15 y11" , "Segoe ui" , 110 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Button Text:" , "s12 c" Brush " x17 y38" , "Segoe ui" , 120 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 95 , 35 , 181 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 95 , 35 , 181 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Button Width:" , "s12 c" Brush " x17 y68" , "Segoe ui" , 120 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 100 , 65 , 44 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 99 , 65 , 46 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Button Height:" , "s12 c" Brush " x151 y68" , "Segoe ui" , 120 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 238 , 65 , 44 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 237 , 65 , 46 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF006666" ) , Gdip_TextToGraphics( G , "Background Color:" , "s12 c" Brush " x17 y98" , "Segoe ui" , 120 , 50 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 124 , 95 , 114 , 22 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 124 , 95 , 114 , 22 ) , Gdip_DeletePen( Pen )
	;Color get button
	Brush := Gdip_CreateLineBrushFromRect( 245 , 96 , 35 , 21 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 245 , 95 , 37 , 22 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 244 , 95 , 38 , 34 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 245 , 95 , 37 , 22 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 247 , 95 , 33 , 22 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Get" , "s12  Bold c" Brush " x252 y98" , "Segoe ui" , 50 , 50 ) , Gdip_DeleteBrush( Brush )
	
	

	
	
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

Background(){
	local w
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( w:=1100 , h:=590 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 ) , Gdip_SetInterpolationMode( G , 7)
	Brush := Gdip_BrushCreateSolid( "0xFF0D0D0D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 1102 , 592 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF000000" , 1 ) , Gdip_DrawRectangle( G , Pen , 0 , 0 , w-1 , h-1 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 2 , 2 , w-5 , h-5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF121212" ) , Gdip_FillRectangle( G , Brush , 9 , 39 , 1082 , 542 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 10 , 40 , 1080 , 540 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 20 , 50 , 83 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 20 , 50 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 20 , 50 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "ALL" , "s12 Center vCenter Bold c" Brush " x20 y51" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 20 , 50 , 83 , 20 , "0xFF006666" , "0xFF000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 105 , 50 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 105 , 50 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 107 , 52 , 77 , 16 , "0xFF006666" , "0xFFffffff" , 1 , 1 ) , Gdip_TextToGraphics( G , "DEFAULT" , "s12 Center vCenter Bold c" Brush " x105 y51" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 20 , 50 , 83 , 20 , "0xFF1f1f1f" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 190 , 50 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 190 , 50 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "HOVER" , "s12 Center vCenter Bold c" Brush " x190 y51" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 20 , 50 , 83 , 20 , "0xFF1F1F1F" , "0xFF121212" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 275 , 50 , 80 , 20 , 5 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 275 , 50 , 80 , 20 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_TextToGraphics( G , "PRESSED" , "s12 Center vCenter Bold c" Brush " x275 y51" , "Segoe ui" , 80 , 20 ) , Gdip_DeleteBrush( Brush )
	;Banner
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRoundedRectangle( G , Brush , 10 , 5 , 610 , 30 , 7 ) , Gdip_DeleteBrush( Brush )
	w := 10
	loop ,% 610 / w	{
		Brush := Gdip_CreateLineBrushFromRect( 0 , 50 , w , 20  , "0x07006666" , "0x44121212"  , 0 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 10 , 5 , 610 , 30 , 7 ) , Gdip_DeleteBrush( Brush )
		w+=10
	}
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 10 , 5 , 610 , 30 , 7 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" )
	Gdip_TextToGraphics( G , "HB Button Maker v1.01" , "s24 Center vCenter Bold c" Brush " x12 y7" , "Segoe UI" , 610 , 30 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 10 , 5 , 610 , 30 , "0xFF002222" , "0xFF009999" , 1 , 1 )
	Gdip_TextToGraphics( G , "HB Button Maker v1.01" , "s24 Center vCenter Bold c" Brush " x10 y5" , "Segoe UI" , 610 , 30 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ),Gdip_FillRectangle( G , Brush , 15 , 80 , 1070 , 495 ),Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 15 , 80 , 1070 , 495 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF1D1D1D" ) , Gdip_FillRectangle( G , Brush , 320 , 465 , 755 , 95 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 320 , 465 , 755 , 95 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 324 , 469 , 641 , 86 ) , Gdip_DeletePen( Pen )
	
	
	
	
	;x975 y500 w90 h45
	Brush := Gdip_BrushCreateSolid( "0xFF171717" ) , Gdip_FillRectangle( G , Brush , 970 , 472 , 100 , 82 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 970 , 472 , 100 , 82 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF071111" , 4 ) , Gdip_DrawRectangle( G , Pen , 973 , 475 , 95 , 77 ) , Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 974 , 476 , 92 , 74 ) , Gdip_DeletePen( Pen )
	
	
	
	;update button ;37w 22h
	Brush := Gdip_CreateLineBrushFromRect( 980 , 515 , 80 , 30 , "0xFF2d2d2d" , "0xFF0d0d0d" , 1 , 1 ) , Gdip_FillRectangle( G , Brush , 980 , 515 , 80 , 30 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 980 , 515 , 80 , 30 , "0xFF006666" , "0xFF121212" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 980 , 515 , 80 , 30 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 980 , 515 , 80 , 30 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Update" , "s12 vCenter Center Bold c" Brush " x980 y516" , "Segoe ui" , 80 , 30 ) , Gdip_DeleteBrush( Brush )
	
	Brush := Gdip_BrushCreateSolid( "0xFF171717" ) , Gdip_FillRoundedRectangle( G , Brush , 370 , 45 , 340 , 30 , 5 ) , Gdip_DeleteBrush( Brush )
	w := 10
	loop, 33	{
		Brush := Gdip_CreateLineBrushFromRect( 370 , 45 , w , 30 , "0x44121212" , "0x07006666" , 0 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 370 , 45 , 340 , 30  , 5 ) , Gdip_DeleteBrush( Brush )
		w+=10
	}
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 370 , 45 , 340 , 30 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 370 , 45 , 340 , 30 , "0xFF00aaaa" , "0xFF006666" , 1 , 1 ) , Gdip_TextToGraphics( G , "Button Name: " , "s14 vCenter Bold c" Brush " x380 y46" , "Segoe ui" , 340 , 30 ) , Gdip_DeleteBrush( Brush )
	
	Pen := Gdip_CreatePen( "0xFF004444" , 1 ) , Gdip_DrawRectangle( G , Pen , 484 , 49 , 211 , 23 ) , Gdip_DeletePen( Pen )
	
	;~ x485 y50 w210 h22
	
	
	
	
	
	Gdip_DeleteGraphics( G )
	return pBitmap
}


AddClosePanel( obj ){
	local hwnd
	
	Gui, 1:Add, Pic, x970 y7 w120 h30 0xE hwndhwnd
	obj.TextColorPanelHwnd := hwnd
	SetImage( hwnd , handle := CloseButtons() )
	DeleteObject( handle )
	;****************************************************************************************************
	
	;~ ;Question Button
	Gui, 1:Add, Text,cWhite x977 y12 w32 h19 BackgroundTrans gGotoThreadTopic
	;~ ;Minimize Button
	Gui, 1:Add, Text,cWhite x1014 y12 w32 h19 BackgroundTrans gMinimizeWindow
	;~ ;Close Button
	Gui, 1:Add, Text,cWhite x1051 y12 w32 h19 BackgroundTrans gGuiClose
	;****************************************************************************************************
}
CloseButtons(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 120 , 30 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF0D0D0D" ) , Gdip_FillRectangle( G , Brush , -1 , -1 , 122 , 32 ) , Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 2 , 3 , 117 , 24 , "0xFF1D1D1D" , "0xFF0B4747" , 0 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 116 , 25 , 4 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 2 , 3 , 117 , 24 , "0xFF1D1D1D" , "0x990B4747" , 0 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 116 , 25 , 4 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0x33004444" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 116 , 25 , 5 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 17 , 8 , 81 , 14 , "0xFF1D1D1D" , "0x99004444" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 7 , 5 , 106 , 19 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0x33004444" , 1 ) , Gdip_DrawEllipse( G , Pen , 7 , 5 , 106 , 19 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 9 , 7 , 28 , 13 , "0xFF121212" , "0x99004444" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 7 , 5 , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "?" , "s14 Center vCenter Bold c" Brush " x7 y6" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF00aaaa" ) , Gdip_TextToGraphics( G , "?" , "s14 Center vCenter Bold c" Brush " x8 y7" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0x33004444" , 2 ) , Gdip_DrawEllipse( G , Pen , 7 , 5 , 32 , 19 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 44 , 6 , 29 , 17 , "0xFF121212" , "0x99004444" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 44 , 5 , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "_" , "s14 Center vCenter Bold c" Brush " x44 y2" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF00aaaa" ) , Gdip_TextToGraphics( G , "_" , "s14 Center vCenter Bold c" Brush " x45 y3" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0x33004444" , 2 ) , Gdip_DrawEllipse( G , Pen , 44 , 5 , 32 , 19 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 81 , 7 , 30 , 15 , "0xFF121212" , "0xFF004444" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 81 , 5 , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Pen := Gdip_CreatePen( "0x33004444" , 2 ) , Gdip_DrawEllipse( G , Pen , 81 , 5 , 32 , 19 ) , Gdip_DeletePen( Pen )
	Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "x" , "s14 Center vCenter Bold c" Brush " x81 y6" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF00aaaa" ) , Gdip_TextToGraphics( G , "x" , "s14 Center vCenter Bold c" Brush " x82 y7" , "Segoe ui" , 32 , 19 ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
	Gdip_DisposeImage( pBitmap )
	return hBitmap
}

UpdateButton:
	counter := 0
	GetEdits( MainObj , CurrentTab )
	if(MainObj.Tab[CurrentTab]="All"){
		for k, v in ["Default","Hover","Pressed"]{
			for i, j in MainObj[v]{
				if( MainObj["All"][i]!="" && i != "GlossyPanelUseGlossyCheckbox" )
					MainObj[v][i] := MainObj["All"][i]
				if( i = "GlossyPanelUseGlossyCheckbox" && GlossyChange ){
					MainObj[v][i] := MainObj["All"][i]  
					;~ ToolTip, % "glossy changed`ncounter: " ++counter
				}
			}
		}
		GlossyChange := 0
	}
	SetImage( Pichwnd , handle := CenterPanel( w , h , MainObj.Tab[CurrentTab] , MainObj[MainObj.Tab[CurrentTab]] , MainObj ) )
	DeleteObject( handle )
	SetDisplayWindow( MainObj )
	return

GetColor:
	CoordMode, Mouse, Screen
	CoordMode, Pixel, Screen
	MouseGetPos,,,,ctrl2,2
	While(!GetKeyState("ctrl")){
		ToolTip, Press "CTRL" to capture screen color under cursor. 
		Sleep, 60
	}
	ToolTip,
	MouseGetPos, x, y
	PixelGetColor, out, x, y, rgb
	StringRight, out, out, 6
	guiControl,1:Focus, % MainObj.ButtonHandles[ctrl2] 
	guiControl,1:, % MainObj.ButtonHandles[ctrl2] , % "" out 
	SendMessage, 0xB1, -2, -1,, % "ahk_id " MainObj.ButtonHandles[ctrl2]
	return

MoveWindow:
	PostMessage, 0xA1, 2
	return

ToggleGlossy:
	MainObj[MainObj.Tab[CurrentTab]].GlossyPanelUseGlossyCheckbox := !MainObj[MainObj.Tab[CurrentTab]].GlossyPanelUseGlossyCheckbox
	SetImage( MainObj.GlossyPanelHwnd  , handle := Glossy( MainObj[MainObj.Tab[CurrentTab]].GlossyPanelUseGlossyCheckbox ) )
	DeleteObject( handle )
	RedrawGlossyEdits(MainObj)
	if( MainObj.Tab[CurrentTab] = "ALL" )
		GlossyChange := 1
	return

RedrawGlossyEdits(Obj){
	for k, v in ["GlossyPanelTopColorAlphaEdit","GlossyPanelTopColorEdit","GlossyPanelBottomColorAlphaEdit","GlossyPanelBottomColorEdit","GlossyPanelAccentColorAlphaEdit","GlossyPanelAccentColorEdit"]
		GuiControl, 1:+Redraw, % Obj.Edits[v]
}

SetDefaults(ByRef Obj){
	local w := 200 , h := 65
	Obj.All := {}
	Obj.Default := {}
	Obj.Hover := {}
	Obj.Pressed := {}
	
	;**************************************************************************
	
	Obj.All.ButtonPanelTextEdit := ""
	Obj.All.ButtonPanelBackgroundColorEdit := "22262A"
	Obj.All.ButtonPanelWidthEdit := w
	Obj.All.ButtonPanelHeightEdit := h
	Obj.All.FontPanelFontEdit := ""
	Obj.All.FontPanelFontOptionsEdit := ""
	Obj.All.FontPanelFontSizeEdit := ""
	Obj.All.FontPanelHOffsetEdit := ""
	Obj.All.FontPanelWOffsetEdit := ""
	Obj.All.FontPanelXOffsetEdit := ""
	Obj.All.FontPanelYOffsetEdit := ""
	
	Obj.All.TextColorPanelBottomColor1AlphaEdit := ""
	Obj.All.TextColorPanelBottomColor1Edit := ""
	Obj.All.TextColorPanelBottomColor2AlphaEdit := ""
	Obj.All.TextColorPanelBottomColor2Edit := ""
	Obj.All.TextColorPanelTopColor1AlphaEdit := ""
	Obj.All.TextColorPanelTopColor1Edit := ""
	Obj.All.TextColorPanelTopColor2AlphaEdit := ""
	Obj.All.TextColorPanelTopColor2Edit := ""
	
	Obj.All.GlossyPanelUseGlossyCheckbox := ""
	
	Obj.All.GlossyPanelTopColorAlphaEdit := ""
	Obj.All.GlossyPanelTopColorEdit := ""
	
	Obj.All.GlossyPanelBottomColorAlphaEdit := ""
	Obj.All.GlossyPanelBottomColorEdit := ""
	
	Obj.All.GlossyPanelAccentColorAlphaEdit := ""
	Obj.All.GlossyPanelAccentColorEdit := ""
	
	Obj.All.ButtonColorPanelOuterBorderColorAlphaEdit := ""
	Obj.All.ButtonColorPanelOuterBorderColorEdit := ""
	
	Obj.All.ButtonColorPanelCenterBorderColorAlphaEdit := ""
	Obj.All.ButtonColorPanelCenterBorderColorEdit := ""
	
	Obj.All.ButtonColorPanelInnerBorderColor1AlphaEdit := "" 
	Obj.All.ButtonColorPanelInnerBorderColor1Edit := ""
	Obj.All.ButtonColorPanelInnerBorderColor2AlphaEdit := ""
	Obj.All.ButtonColorPanelInnerBorderColor2Edit := ""
	
	Obj.All.ButtonColorPanelMainColor1AlphaEdit := ""
	Obj.All.ButtonColorPanelMainColor1Edit := ""
	Obj.All.ButtonColorPanelMainColor2AlphaEdit := ""
	Obj.All.ButtonColorPanelMainColor2Edit := ""
	
	;**************************************************************************
	
	Obj.Default.ButtonPanelTextEdit := "Button"
	Obj.Default.ButtonPanelBackgroundColorEdit := "22262A"
	Obj.Default.ButtonPanelWidthEdit := w
	Obj.Default.ButtonPanelHeightEdit := h
	Obj.Default.FontPanelFontEdit := "Arial"
	Obj.Default.FontPanelFontOptionsEdit := " Bold Center vCenter "
	Obj.Default.FontPanelFontSizeEdit := "12"
	Obj.Default.FontPanelHOffsetEdit := 0
	Obj.Default.FontPanelWOffsetEdit := 0
	Obj.Default.FontPanelXOffsetEdit := 0
	Obj.Default.FontPanelYOffsetEdit := 0
	
	Obj.Default.TextColorPanelBottomColor1AlphaEdit := "00"
	Obj.Default.TextColorPanelBottomColor1Edit := "02112F"
	Obj.Default.TextColorPanelBottomColor2AlphaEdit := Obj.Default.TextColorPanelBottomColor1AlphaEdit
	Obj.Default.TextColorPanelBottomColor2Edit := Obj.Default.TextColorPanelBottomColor1Edit
	Obj.Default.TextColorPanelTopColor1AlphaEdit := "FF"
	Obj.Default.TextColorPanelTopColor1Edit := "FFFFFF"
	Obj.Default.TextColorPanelTopColor2AlphaEdit := Obj.Default.TextColorPanelTopColor1AlphaEdit
	Obj.Default.TextColorPanelTopColor2Edit := Obj.Default.TextColorPanelTopColor1Edit
	
	Obj.Default.GlossyPanelUseGlossyCheckbox := 1
	
	Obj.Default.GlossyPanelTopColorAlphaEdit := "11"
	Obj.Default.GlossyPanelTopColorEdit := "FFFFFF"
	
	Obj.Default.GlossyPanelBottomColorAlphaEdit := "33"
	Obj.Default.GlossyPanelBottomColorEdit := "000000"
	
	Obj.Default.GlossyPanelAccentColorAlphaEdit := "05"
	Obj.Default.GlossyPanelAccentColorEdit := "FFFFFF"
	
	Obj.Default.ButtonColorPanelOuterBorderColorAlphaEdit := "FF"
	Obj.Default.ButtonColorPanelOuterBorderColorEdit := "161B1F"
	
	Obj.Default.ButtonColorPanelCenterBorderColorAlphaEdit := "FF"
	Obj.Default.ButtonColorPanelCenterBorderColorEdit := "262B2F"
	
	Obj.Default.ButtonColorPanelInnerBorderColor1AlphaEdit := "FF" 
	Obj.Default.ButtonColorPanelInnerBorderColor1Edit := "3F444A"
	Obj.Default.ButtonColorPanelInnerBorderColor2AlphaEdit := "FF"
	Obj.Default.ButtonColorPanelInnerBorderColor2Edit := "24292D"
	
	Obj.Default.ButtonColorPanelMainColor1AlphaEdit := "FF"
	Obj.Default.ButtonColorPanelMainColor1Edit := "272C32"
	Obj.Default.ButtonColorPanelMainColor2AlphaEdit := Obj.Default.ButtonColorPanelMainColor1AlphaEdit
	Obj.Default.ButtonColorPanelMainColor2Edit := Obj.Default.ButtonColorPanelMainColor1Edit
	
	
	;*************************************************************************************
	
	Obj.Hover.ButtonPanelTextEdit := "Button"
	Obj.Hover.ButtonPanelBackgroundColorEdit := "22262A"
	Obj.Hover.ButtonPanelWidthEdit := w
	Obj.Hover.ButtonPanelHeightEdit := h
	Obj.Hover.FontPanelFontEdit := "Arial"
	Obj.Hover.FontPanelFontOptionsEdit := " Bold Center vCenter "
	Obj.Hover.FontPanelFontSizeEdit := "12"
	Obj.Hover.FontPanelHOffsetEdit := 0
	Obj.Hover.FontPanelWOffsetEdit := 0
	Obj.Hover.FontPanelXOffsetEdit := 0
	Obj.Hover.FontPanelYOffsetEdit := 0
	
	Obj.Hover.TextColorPanelBottomColor1AlphaEdit := "00"
	Obj.Hover.TextColorPanelBottomColor1Edit := "02112F"
	Obj.Hover.TextColorPanelBottomColor2AlphaEdit := Obj.Hover.TextColorPanelBottomColor1AlphaEdit
	Obj.Hover.TextColorPanelBottomColor2Edit := Obj.Hover.TextColorPanelBottomColor1Edit
	Obj.Hover.TextColorPanelTopColor1AlphaEdit := "FF"
	Obj.Hover.TextColorPanelTopColor1Edit := "FFFFFF"
	Obj.Hover.TextColorPanelTopColor2AlphaEdit := Obj.Hover.TextColorPanelTopColor1AlphaEdit
	Obj.Hover.TextColorPanelTopColor2Edit := Obj.Hover.TextColorPanelTopColor1Edit
	
	Obj.Hover.GlossyPanelUseGlossyCheckbox := 1
	
	Obj.Hover.GlossyPanelTopColorAlphaEdit := "11"
	Obj.Hover.GlossyPanelTopColorEdit := "FFFFFF"
	
	Obj.Hover.GlossyPanelBottomColorAlphaEdit := "33"
	Obj.Hover.GlossyPanelBottomColorEdit := "000000"
	
	Obj.Hover.GlossyPanelAccentColorAlphaEdit := "05"
	Obj.Hover.GlossyPanelAccentColorEdit := "FFFFFF"
	
	Obj.Hover.ButtonColorPanelOuterBorderColorAlphaEdit := "FF"
	Obj.Hover.ButtonColorPanelOuterBorderColorEdit := "161B1F"
	
	Obj.Hover.ButtonColorPanelCenterBorderColorAlphaEdit := "FF"
	Obj.Hover.ButtonColorPanelCenterBorderColorEdit := "262B2F"
	
	Obj.Hover.ButtonColorPanelInnerBorderColor1AlphaEdit := "FF" 
	Obj.Hover.ButtonColorPanelInnerBorderColor1Edit := "3F444A"
	Obj.Hover.ButtonColorPanelInnerBorderColor2AlphaEdit := "FF"
	Obj.Hover.ButtonColorPanelInnerBorderColor2Edit := "24292D"
	
	Obj.Hover.ButtonColorPanelMainColor1AlphaEdit := "FF"
	Obj.Hover.ButtonColorPanelMainColor1Edit := "373C42"
	Obj.Hover.ButtonColorPanelMainColor2AlphaEdit := Obj.Hover.ButtonColorPanelMainColor1AlphaEdit
	Obj.Hover.ButtonColorPanelMainColor2Edit := Obj.Hover.ButtonColorPanelMainColor1Edit
	
	
	
	
	;*******************************************************************************************
	
	Obj.Pressed.ButtonPanelTextEdit := "Button"
	Obj.Pressed.ButtonPanelBackgroundColorEdit := "22262A"
	Obj.Pressed.ButtonPanelWidthEdit := w
	Obj.Pressed.ButtonPanelHeightEdit := h
	Obj.Pressed.FontPanelFontEdit := "Arial"
	Obj.Pressed.FontPanelFontOptionsEdit := " Bold Center vCenter "
	Obj.Pressed.FontPanelFontSizeEdit := "12"
	Obj.Pressed.FontPanelHOffsetEdit := 0
	Obj.Pressed.FontPanelWOffsetEdit := 0
	Obj.Pressed.FontPanelXOffsetEdit := 0
	Obj.Pressed.FontPanelYOffsetEdit := 0
	
	Obj.Pressed.TextColorPanelBottomColor1AlphaEdit := "00"
	Obj.Pressed.TextColorPanelBottomColor1Edit := "02112F"
	Obj.Pressed.TextColorPanelBottomColor2AlphaEdit := Obj.Pressed.TextColorPanelBottomColor1AlphaEdit
	Obj.Pressed.TextColorPanelBottomColor2Edit := Obj.Pressed.TextColorPanelBottomColor1Edit
	Obj.Pressed.TextColorPanelTopColor1AlphaEdit := "FF"
	Obj.Pressed.TextColorPanelTopColor1Edit := "FFFFFF"
	Obj.Pressed.TextColorPanelTopColor2AlphaEdit := Obj.Pressed.TextColorPanelTopColor1AlphaEdit
	Obj.Pressed.TextColorPanelTopColor2Edit := Obj.Pressed.TextColorPanelTopColor1Edit
	
	Obj.Pressed.GlossyPanelUseGlossyCheckbox := 0
	
	Obj.Pressed.GlossyPanelTopColorAlphaEdit := "11"
	Obj.Pressed.GlossyPanelTopColorEdit := "FFFFFF"
	
	Obj.Pressed.GlossyPanelBottomColorAlphaEdit := "33"
	Obj.Pressed.GlossyPanelBottomColorEdit := "000000"
	
	Obj.Pressed.GlossyPanelAccentColorAlphaEdit := "05"
	Obj.Pressed.GlossyPanelAccentColorEdit := "FFFFFF"
	
	Obj.Pressed.ButtonColorPanelOuterBorderColorAlphaEdit := "FF"
	Obj.Pressed.ButtonColorPanelOuterBorderColorEdit := "62666a"
	
	Obj.Pressed.ButtonColorPanelCenterBorderColorAlphaEdit := "FF"
	Obj.Pressed.ButtonColorPanelCenterBorderColorEdit := "262B2F"
	
	Obj.Pressed.ButtonColorPanelInnerBorderColor1AlphaEdit := "FF" 
	Obj.Pressed.ButtonColorPanelInnerBorderColor1Edit := "151A20"
	Obj.Pressed.ButtonColorPanelInnerBorderColor2AlphaEdit := "FF"
	Obj.Pressed.ButtonColorPanelInnerBorderColor2Edit := "151A20"
	
	Obj.Pressed.ButtonColorPanelMainColor1AlphaEdit := "FF"
	Obj.Pressed.ButtonColorPanelMainColor1Edit := "12161a"
	Obj.Pressed.ButtonColorPanelMainColor2AlphaEdit := "FF"
	Obj.Pressed.ButtonColorPanelMainColor2Edit := "33383E"
	
}

ClipButton( Obj ){
	local ProjectName , output
	GuiControlGet, ProjectName, 1:, % Obj.ProjectName
	( !ProjectName ) ? ( ProjectName := "MyButtonDesign" )
	ProjectName := StrReplace( ProjectName , " " , "" )
	output := "HBCustomButton(){`n`tlocal " ProjectName " := {}`n`t"
	output .= ProjectName ".All := {}`n`t"
	output .= ProjectName ".Default := {}`n`t"
	output .= ProjectName ".Hover := {}`n`t"
	output .= ProjectName ".Pressed := {}`n`t"
	;*************************************************************************************************************************************************************************
	arr := ["All","Default","Hover","Pressed"] , stopped := 0
	loop, 4 	{
		output .= ";********************************`n`t"
		output .= ";" Arr[A_Index] "`n`t"
		if( MainObj[Arr[A_Index]].ButtonPanelWidthEdit != "" )
			output .=  ProjectName "." Arr[A_Index] ".W := " MainObj[Arr[A_Index]].ButtonPanelWidthEdit
		if( MainObj[Arr[A_Index]].ButtonPanelHeightEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".H := " MainObj[Arr[A_Index]].ButtonPanelHeightEdit
		if( MainObj[Arr[A_Index]].ButtonPanelTextEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".Text := """ MainObj[Arr[A_Index]].ButtonPanelTextEdit """"
		else
			output .= " , " ProjectName "." Arr[A_Index] ".Text := "" Button """
		if( MainObj[Arr[A_Index]].FontPanelFontEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".Font := """ MainObj[Arr[A_Index]].FontPanelFontEdit """"
		if( MainObj[Arr[A_Index]].FontPanelFontOptionsEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".FontOptions := """ MainObj[Arr[A_Index]].FontPanelFontOptionsEdit """"
		if( MainObj[Arr[A_Index]].FontPanelFontSizeEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".FontSize := """ MainObj[Arr[A_Index]].FontPanelFontSizeEdit """"
		if( MainObj[Arr[A_Index]].TextColorPanelBottomColor1AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".H := ""0x" MainObj[Arr[A_Index]].TextColorPanelBottomColor1AlphaEdit . MainObj[Arr[A_Index]].TextColorPanelBottomColor1Edit """"
		if( MainObj[Arr[A_Index]].TextColorPanelBottomColor2AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextBottomColor2 := ""0x" MainObj[Arr[A_Index]].TextColorPanelBottomColor2AlphaEdit . MainObj[Arr[A_Index]].TextColorPanelBottomColor2Edit """"
		if( MainObj[Arr[A_Index]].TextColorPanelTopColor1AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextTopColor1 := ""0x" MainObj[Arr[A_Index]].TextColorPanelTopColor1AlphaEdit . MainObj[Arr[A_Index]].TextColorPanelTopColor1Edit """"
		if( MainObj[Arr[A_Index]].TextColorPanelTopColor2AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextTopColor2 := ""0x" MainObj[Arr[A_Index]].TextColorPanelTopColor2AlphaEdit . MainObj[Arr[A_Index]].TextColorPanelTopColor2Edit """"
		if( MainObj[Arr[A_Index]].FontPanelXOffsetEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextOffsetX := """ MainObj[Arr[A_Index]].FontPanelXOffsetEdit """"
		if( MainObj[Arr[A_Index]].FontPanelYOffsetEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextOffsetY := """ MainObj[Arr[A_Index]].FontPanelYOffsetEdit """"
		if( MainObj[Arr[A_Index]].FontPanelWOffsetEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextOffsetW := """ MainObj[Arr[A_Index]].FontPanelWOffsetEdit """"
		if( MainObj[Arr[A_Index]].FontPanelHOffsetEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".TextOffsetH := """ MainObj[Arr[A_Index]].FontPanelHOffsetEdit """"
		if( MainObj[Arr[A_Index]].ButtonPanelBackgroundColorEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".BackgroundColor := ""0xFF" MainObj[Arr[A_Index]].ButtonPanelBackgroundColorEdit """" ; May need to change this later. Not sure if I remember if bg color needs 0x and alpha
		if( MainObj[Arr[A_Index]].ButtonColorPanelOuterBorderColorAlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonOuterBorderColor := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelOuterBorderColorAlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelOuterBorderColorEdit """"
		if( MainObj[Arr[A_Index]].ButtonColorPanelCenterBorderColorAlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonCenterBorderColor := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelCenterBorderColorAlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelCenterBorderColorEdit """"
		if( MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor1AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonInnerBorderColor1 := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor1AlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor1Edit """"
		if( MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor2AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonInnerBorderColor2 := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor2AlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelInnerBorderColor2Edit """"
		if( MainObj[Arr[A_Index]].ButtonColorPanelMainColor1AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonMainColor1 := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelMainColor1AlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelMainColor1Edit """"
		if( MainObj[Arr[A_Index]].ButtonColorPanelMainColor2AlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonMainColor2 := ""0x" MainObj[Arr[A_Index]].ButtonColorPanelMainColor2AlphaEdit . MainObj[Arr[A_Index]].ButtonColorPanelMainColor2Edit """"
		if( MainObj[Arr[A_Index]].GlossyPanelUseGlossyCheckbox != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".ButtonAddGlossy := """ MainObj[Arr[A_Index]].GlossyPanelUseGlossyCheckbox """"
		if( MainObj[Arr[A_Index]].GlossyPanelTopColorAlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".GlossTopColor := ""0x" MainObj[Arr[A_Index]].GlossyPanelTopColorAlphaEdit . MainObj[Arr[A_Index]].GlossyPanelTopColorEdit """"
		if( MainObj[Arr[A_Index]].GlossyPanelAccentColorAlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".GlossTopAccentColor := """ MainObj[Arr[A_Index]].GlossyPanelAccentColorAlphaEdit . MainObj[Arr[A_Index]].GlossyPanelAccentColorEdit """"
		if( MainObj[Arr[A_Index]].GlossyPanelBottomColorAlphaEdit != "" )
			output .= " , " ProjectName "." Arr[A_Index] ".GlossBottomColor := """ MainObj[Arr[A_Index]].GlossyPanelBottomColorAlphaEdit . MainObj[Arr[A_Index]].GlossyPanelBottomColorEdit """"
		output .= "`n`t"
	}
	;*************************************************************************************************************************************************************************
	output .= ";********************************`n`t"
	output .= "`n`t"
	output .= "return " ProjectName "`n"
	output .= "}"
	Clipboard := output
	SoundBeep, 500
	SoundBeep, 500
}

Class Custom_Window	{
	__New(x:="",y:="",w:=300,h:=200,Name:=1,Options:="+AlwaysOnTop -Caption -DPIScale",Title:="",Background_Bitmap:=""){
		This.X:=x
		This.Y:=y
		This.W:=w
		This.H:=h
		This.Name:=Name
		This.Title:=Title
		This.Options:=Options
		This.Background_Bitmap:=Background_Bitmap
		This.Create_Window()
	}
	Create_Window(){
		Gui,% This.Name ":New",%  This.Options " +LastFound"
		This.Hwnd:=WinExist()
		if(This.Background_Bitmap)
			This.Draw_Background_Bitmap()
	}
	Draw_Background_Bitmap(){
		local hwnd
		This.Bitmap:=Gdip_CreateHBITMAPFromBitmap(This.Background_Bitmap)
		Gdip_DisposeImage(This.Background_Bitmap)
		Gui,% This.Name ":Add",Picture,% "x0 y0 w" This.W " h" This.H " 0xE hwndhwnd"
		This.Background_Hwnd:=hwnd
		SetImage(This.Background_Hwnd,This.Bitmap)
		
	}
	Show_Window(){
		if(This.X&&This.Y)
			Gui,% This.Name ":Show",% "x" This.X " y" This.Y " w" This.W " h" This.H,% This.Title
		else if(This.X&&!This.Y)
			Gui,% This.Name ":Show",% "x" This.X  " w" This.W " h" This.H,% This.Title
		else if(!This.X&&This.Y)
			Gui,% This.Name ":Show",% "y" This.Y  " w" This.W " h" This.H,% This.Title
		else
			Gui,% This.Name ":Show",% " w" This.W " h" This.H,% This.Title
	}
}


I see the icon with no issues.
20211005023428.png
20211005023428.png (1.62 KiB) Viewed 1501 times
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 02:03

For me there was no error, tested on Windows 7 and Windows 10.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 02:09

teadrinker wrote:
05 Oct 2021, 02:03
For me there was no error, tested on Windows 7 and Windows 10.
Thank you.
User avatar
Hellbent
Posts: 2102
Joined: 23 Sep 2017, 13:34

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 02:27

I went looking to see if I had a recording of the error message and it does look like "hIcon" is empty, not sure why though.
20211005031939.png
20211005031939.png (33.38 KiB) Viewed 1469 times
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 09:40

Tested on windows 10 with no issues.
image.png
image.png (104.9 KiB) Viewed 1383 times
iseahound
Posts: 1434
Joined: 13 Aug 2016, 21:04
Contact:

Re: Create a Icon from pBitmap / hBitmap

05 Oct 2021, 11:58

https://devblogs.microsoft.com/oldnewthing/20101022-00/?p=12473 wrote:We finish our tour of the evolution of the ICO file format with the introduction of PNG-compressed images in Windows Vista. [...] Paradoxically, the way to be more compatible is to be less compatible. The format of a PNG-compressed image consists simply of a PNG image, starting with the PNG file signature.
@teadrinker
So Windows decided that to accept a PNG file as a ICO file because of the compression and alpha channel... And that's why CreateIconFromResourceEx accepts PNGs?

Wow.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat, wilkster and 130 guests