[Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Wow, that's amazing, very impressive
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
v2.2.7
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.7
-Fixed an issue where the elements of a copied layer were actually still connected.
-Fixed DPI scaling for the inner display window
-Fixed font size for the DrawText element so that it scales
-Added a display window that shows save progress.
-Fixed issues with being able to mess up a save by making changes to the bitmap while it is being saved.
-Added B64ICON element type. Accepts a B64 string of up to 15000 characters.
Base 64 Icons
You can now add b64 icons.
-Icon B64 strings need to be a single line.
-Icon b64 strings should be squares (equal width and height [64x64], [32x32], etc.. ), Hereafter called the "Icon Size" or "IconSize".
-Icons are positioned via a vector, i.e. the x/y of the center of the icon (*the extra pixel goes to the left and top if the size is an even number).
Creating B64 Icons
You can use this AHK v1 script to create the B64 icons.
viewtopic.php?f=76&t=101960&start=20#p534041
You can create icons from screen clips or load a number of image types from your clipboard. (see the next gif? you can Right Click => "Copy Image" and then press the load from clipboard button on the Icon maker, likewise if you have the path to an image in your clipboard).
You can even put a B64 string into your clipboard and then load that into the icon maker (i.e. A way of converting B64 format and size).
. .
Adding a B64ICON to a bitmap.
1. Create a new image (New Bitmap)
2. Add B64ICON elements
3. Replace the default b64
4. Save the bitmap.
5. Use the generated function in a script (see below for example of using the output)
. .
Code output example:
. .
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.7
-Fixed an issue where the elements of a copied layer were actually still connected.
-Fixed DPI scaling for the inner display window
-Fixed font size for the DrawText element so that it scales
-Added a display window that shows save progress.
-Fixed issues with being able to mess up a save by making changes to the bitmap while it is being saved.
-Added B64ICON element type. Accepts a B64 string of up to 15000 characters.
Base 64 Icons
You can now add b64 icons.
-Icon B64 strings need to be a single line.
-Icon b64 strings should be squares (equal width and height [64x64], [32x32], etc.. ), Hereafter called the "Icon Size" or "IconSize".
-Icons are positioned via a vector, i.e. the x/y of the center of the icon (*the extra pixel goes to the left and top if the size is an even number).
Creating B64 Icons
You can use this AHK v1 script to create the B64 icons.
viewtopic.php?f=76&t=101960&start=20#p534041
You can create icons from screen clips or load a number of image types from your clipboard. (see the next gif? you can Right Click => "Copy Image" and then press the load from clipboard button on the Icon maker, likewise if you have the path to an image in your clipboard).
You can even put a B64 string into your clipboard and then load that into the icon maker (i.e. A way of converting B64 format and size).
. .
Adding a B64ICON to a bitmap.
1. Create a new image (New Bitmap)
2. Add B64ICON elements
3. Replace the default b64
4. Save the bitmap.
5. Use the generated function in a script (see below for example of using the output)
. .
Code output example:
. .
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
pToken := Gdip_Startup()
Gui1 := Gui( "+AlwaysOnTop +E0x02000000 +E0x00080000" )
Gui1.BackColor := "22262a"
Pic1 := Gui1.Add( "Picture" , "xm ym" , "HBitmap: " SampleIconFunction( 1 , "hBitmap" ) )
Gui1.Show()
*ESC::ExitApp
;**************************************( Sample Icon )*********************************************
SampleIconFunction( Scale := 1 , returnType := "pBitmap" ){
local pBitmap := Gdip_CreateBitmap( 300 * Scale , 70 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: -10 + 0 , Y: -30 + 0 , W: 340 , H: 140 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF22262a" } } )
Elements.Push( { Index: 2 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 10 + 0 , Y: 10 + 0 , W: 280 , H: 50 } , Roundness: 14 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 3 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 13 + 0 , Y: 13 + 0 , W: 274 , H: 44 } , Roundness: 14 , Note: "" , BrushObject: { BrushType: "HatchBrush" , Color1: "0x9902A2BE" , Color2: "0x9900ffff" , HatchValue: "10" } } )
Elements.Push( { Index: 4 , Layer: 1 , ElementType: "B64ICON" , StartVector: { X: 39 + 0 , Y: 33 + 0 } , IconSize: 64 , Note: "" } )
Elements[ 4 ].B64String := "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"
Elements.Push( { Index: 5 , Layer: 1 , ElementType: "DrawText" , Rect: { X: 63 + 0 , Y: 13 + 0 , W: 224 , H: 44 } , Text: "Sample" , FontType: "Tahoma" , FontSize: 30 , Center: 1 , vCenter: 1 , Offset: 2 , Bold: 1 , italic: 0 , underline: 0 , Right: 0 , NoWrap: 0 , Strike: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 6 , Layer: 1 , ElementType: "DrawText" , Rect: { X: 63 + 0 , Y: 13 + 0 , W: 224 , H: 44 } , Text: "Sample" , FontType: "Tahoma" , FontSize: 30 , Center: 1 , vCenter: 1 , Offset: 0 , Bold: 1 , italic: 0 , underline: 0 , Right: 0 , NoWrap: 0 , Strike: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFffffff" } } )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 2 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 3 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateHatch( Brush.Color1 , Brush.Color2 , Brush.HatchValue )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 4 ]
StartVector := element.StartVector
Size := element.IconSize
B64String := element.B64String
ImageBitmap := Gdip_BitmapFromBase64( &B64String )
Gdip_DrawImage( pGraphics , ImageBitmap , ( StartVector.X - Ceil( size / 2 ) ) * Scale , ( StartVector.Y - Ceil( size / 2 ) ) * Scale , ( size ) * Scale , ( size ) * Scale )
Gdip_DisposeImage( ImageBitmap )
element := Elements[ 5 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
options := "s" ( element.FontSize ) * scale " c" pBrush " x" ( element.Rect.X + element.Offset ) * scale " y" ( element.Rect.Y + element.Offset ) * scale
options .= ( ( element.Center ) ? ( " Center" ) : ( "" ) ) ( ( element.vCenter ) ? ( " vCenter" ) : ( "" ) ) ( ( element.Bold ) ? ( " Bold" ) : ( "" ) )
options .= ( ( element.Italic ) ? ( " Italic" ) : ( "" ) ) ( ( element.Right ) ? ( " Right" ) : ( "" ) ) ( ( element.Strike ) ? ( " Strikeout" ) : ( "" ) )
options .= ( ( element.Underline ) ? ( " underline" ) : ( "" ) ) ( ( element.NoWrap ) ? ( " NoWrap" ) : ( "" ) )
Gdip_TextToGraphics( pGraphics , element.Text , options , element.FontType , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 6 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
options := "s" ( element.FontSize ) * scale " c" pBrush " x" ( element.Rect.X + element.Offset ) * scale " y" ( element.Rect.Y + element.Offset ) * scale
options .= ( ( element.Center ) ? ( " Center" ) : ( "" ) ) ( ( element.vCenter ) ? ( " vCenter" ) : ( "" ) ) ( ( element.Bold ) ? ( " Bold" ) : ( "" ) )
options .= ( ( element.Italic ) ? ( " Italic" ) : ( "" ) ) ( ( element.Right ) ? ( " Right" ) : ( "" ) ) ( ( element.Strike ) ? ( " Strikeout" ) : ( "" ) )
options .= ( ( element.Underline ) ? ( " underline" ) : ( "" ) ) ( ( element.NoWrap ) ? ( " NoWrap" ) : ( "" ) )
Gdip_TextToGraphics( pGraphics , element.Text , options , element.FontType , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
v2.2.8
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.8
-Fixed some of the warnings.
-Added DrawArc element type.
DrawArc
. .
Example:
. .
Arc1.ini
.
.
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.8
-Fixed some of the warnings.
-Added DrawArc element type.
DrawArc
. .
Example:
. .
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
pToken := Gdip_Startup()
Gui1 := Gui( "+AlwaysOnTop +E0x02000000 +E0x00080000" ) ;+E0x02000000 +E0x00080000 = Less Flickering
Gui1.BackColor := "22262a"
Gui1.Elements := Arc1Elements()
Gui1.Pic1 := Gui1.Add( "Picture" , "xm" , "hBitmap: " Arc1Function( Gui1.Elements ,, "hBitmap" ) )
Gui1.Show()
SetTimer( Update.Bind( Gui1 ) , 30 )
*ESC::ExitApp
Update( Gui1 ){
tog := 0
Loop( Gui1.Elements.Length - 1 ){
if( tog := !tog )
Gui1.Elements[ A_Index + 1 ].StartAngle += 5-A_Index
else
Gui1.Elements[ A_Index + 1 ].StartAngle -= 5-A_Index
}
Gui1.Pic1.Value := "hBitmap: " Arc1Function( Gui1.Elements ,, "hBitmap" )
}
;**************************************( Arc 1 )*********************************************
Arc1Elements(){
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: -10 + 0 , Y: -10 + 0 , W: 320 , H: 330 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF22262a" } } )
Elements.Push( { Index: 2 , Layer: 1 , ElementType: "DrawArc" , Rect: { X: 50 + 0 , Y: 50 + 0 , W: 200 , H: 200 } , StartAngle: "0" , SweepAngle: "300" , Thickness: "11" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF336699" } } )
Elements.Push( { Index: 3 , Layer: 1 , ElementType: "DrawArc" , Rect: { X: 70 + 0 , Y: 70 + 0 , W: 160 , H: 160 } , StartAngle: "90" , SweepAngle: "300" , Thickness: "11" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF3399cc" } } )
Elements.Push( { Index: 4 , Layer: 1 , ElementType: "DrawArc" , Rect: { X: 90 + 0 , Y: 90 + 0 , W: 120 , H: 120 } , StartAngle: "190" , SweepAngle: "300" , Thickness: "11" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF5599cc" } } )
Elements.Push( { Index: 5 , Layer: 1 , ElementType: "DrawArc" , Rect: { X: 110 + 0 , Y: 110 + 0 , W: 80 , H: 80 } , StartAngle: "280" , SweepAngle: "300" , Thickness: "11" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF66aaFF" } } )
return Elements
}
Arc1Function( Elements , Scale := 1 , returnType := "pBitmap" ){
local pBitmap := Gdip_CreateBitmap( 300 * Scale , 300 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 2 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawArc( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.StartAngle , element.SweepAngle )
Gdip_DeletePen( pPen )
element := Elements[ 3 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawArc( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.StartAngle , element.SweepAngle )
Gdip_DeletePen( pPen )
element := Elements[ 4 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawArc( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.StartAngle , element.SweepAngle )
Gdip_DeletePen( pPen )
element := Elements[ 5 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawArc( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.StartAngle , element.SweepAngle )
Gdip_DeletePen( pPen )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
Code: Select all
[Bitmap Data]
Name=Arc 1
Rect=583,390,300,300|
Smoothing=2
InterpolationMode=7
NumberOfLayers=1
IsHidden=0
Note=
Scale=1
[Layer 1 Data]
Name=Layer 1
Rect=0,0,300,300|
Smoothing=2
InterpolationMode=7
NumberOfElements=5
IsHidden=0
Note=
[Layer 1 Element 1 Data]
ElementType=FillRectangle
Rect=-10,-10,320,330|
IsHidden=0
Note=
Roundness=0
[Layer 1 Element 1 Brush Data]
BrushType=SolidBrush
Color1=0xFF22262a
[Layer 1 Element 2 Data]
ElementType=DrawArc
Rect=50,50,200,200|
StartAngle=0
SweepAngle=300
Thickness=11
IsHidden=0
Note=
[Layer 1 Element 2 Brush Data]
BrushType=SolidBrush
Color1=0xFF336699
[Layer 1 Element 3 Data]
ElementType=DrawArc
Rect=70,70,160,160|
StartAngle=90
SweepAngle=300
Thickness=11
IsHidden=0
Note=
[Layer 1 Element 3 Brush Data]
BrushType=SolidBrush
Color1=0xFF3399cc
[Layer 1 Element 4 Data]
ElementType=DrawArc
Rect=90,90,120,120|
StartAngle=190
SweepAngle=300
Thickness=11
IsHidden=0
Note=
[Layer 1 Element 4 Brush Data]
BrushType=SolidBrush
Color1=0xFF5599cc
[Layer 1 Element 5 Data]
ElementType=DrawArc
Rect=110,110,80,80|
StartAngle=280
SweepAngle=300
Thickness=11
IsHidden=0
Note=
[Layer 1 Element 5 Brush Data]
BrushType=SolidBrush
Color1=0xFF66aaFF
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
pToken := Gdip_Startup()
Gui1 := Gui( "+AlwaysOnTop +E0x02000000 +E0x00080000" )
Gui1.BackColor := "22262a"
Gui1.Add( "ListBox" , "w200 Choose1" , ["1","2"])
Gui1.Add( "Button" , "x+m" , "Do Nothing" ).OnEvent( "Click" , DoNothing )
Gui1.Elements := KittElements()
Gui1.Pic1 := Gui1.Add( "Picture" , "xm" , "HBitmap: " Kitt1Function( Gui1.Elements ) )
Gui1.Show()
SetTimer( Update.Bind( Gui1 ) , 90 )
*ESC::ExitApp
DoNothing(*){
ToolTip( "Doing Nothing" )
sleep 1000
ToolTip()
}
Update( Gui1 , * ){
static position := 1
static Direction := 1
local max := 9
if( Direction = 1 )
position++
else
position--
Loop( 9 ){
if( A_Index = position ){
Gui1.Elements[ 1 + A_Index ].BrushObject.Color1 := "0xffFF0000"
}else if( A_Index = ( position + 1 ) || A_Index = ( position - 1 ) ){
Gui1.Elements[ 1 + A_Index ].BrushObject.Color1 := "0xffAA0000"
}else if( A_Index = ( position + 2 ) || A_Index = ( position - 2 ) ){
Gui1.Elements[ 1 + A_Index ].BrushObject.Color1 := "0xff880000"
}else{
Gui1.Elements[ 1 + A_Index ].BrushObject.Color1 := "0x99440000"
}
}
( ( Direction = 1 ) && ( position != max ) ) || ( Direction := 2 )
( ( Direction = 2 ) && ( position != 1 ) ) || ( Direction := 1 )
Gui1.Pic1.Value := "hBitmap: " Kitt1Function( Gui1.Elements )
}
;**************************************( Kitt 1 )*********************************************
KittElements(){
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: -10 + 0 , Y: -10 + 0 , W: 400 , H: 100 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF22262a" } } )
Elements.Push( { Index: 2 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 10 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF440000" } } )
Elements.Push( { Index: 3 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 40 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF880000" } } )
Elements.Push( { Index: 4 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 70 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFaa0000" } } )
Elements.Push( { Index: 5 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 100 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFff0000" } } )
Elements.Push( { Index: 6 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 130 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFaa0000" } } )
Elements.Push( { Index: 7 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 160 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF880000" } } )
Elements.Push( { Index: 8 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 190 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF440000" } } )
Elements.Push( { Index: 9 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 220 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF440000" } } )
Elements.Push( { Index: 10 , Layer: 1 , ElementType: "FillRectangle" , Rect: { X: 250 + 0 , Y: 10 + 0 , W: 20 , H: 20 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF440000" } } )
return Elements
}
Kitt1Function( Elements , Scale := 1 , returnType := "hBitmap" ){
local pBitmap := Gdip_CreateBitmap( 280 * Scale , 40 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 2 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 3 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 4 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 5 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 6 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 7 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 8 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 9 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 10 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Cursor Highlight
*Note: The yellow and red circles in the center are created by the gif software, they could be added though.
. .
Bitmap maker data: .
*Fixed the leak*
*Note: The yellow and red circles in the center are created by the gif software, they could be added though.
. .
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
#Include <HB Vectors v3> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132770&p=583213#p583213
#Include <PopUpWindow v4_1> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132744&p=583099#p583097
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
pToken := Gdip_Startup()
Settings := {}
Settings.Options := "+AlwaysOnTop -DPIScale +ToolWindow +Owner +E0x20"
Settings.Rect := { X: 500 , Y: 130 , W: 100 , H: 100 }
Gui1 := PopupWindow_v4( Settings )
Gui1.Elements := CursorHighlight1Elements()
SetTimer( UpdateCursor.Bind( Gui1 ) , 30 )
;##############################################
;##############################################
;##############################################
*^ESC::ExitApp ;<<<---- Set Exit Hotkey
;##############################################
;##############################################
;##############################################
UpdateCursor( Gui1 , * ){
static LastState := ""
static LastPosition := Vector( 1 , 1 )
local currentState := 0
local pBitmap := "" , colors := ""
local MouseVector := Vector.MouseVector()
MouseVector.Add( -50 , -50 )
if( GetKeyState( "LButton" ) )
currentState := 1
if( GetKeyState( "RButton" ) )
currentState := 2
if( LastPosition.Dist( MouseVector ) > 1 || currentState != LastState ){
LastPosition := MouseVector.Clone()
LastState := currentState
Gui1.Resize( 1 , MouseVector )
switch currentState {
case 0: colors := [ "0x00000000" , "0x00000000" , "0xFF000000" ]
case 1: colors := [ "0x99FFFF00" , "0x99880000" , "0x99FFFF00" ]
case 2: colors := [ "0x99FF0000" , "0x99880000" , "0x99FF0000" ]
}
Loop( 4 ){
Gui1.Elements[ A_Index + 2 ].Color1 := colors[ 1 ]
Gui1.Elements[ A_Index + 2 ].Color2 := colors[ 2 ]
}
Gui1.Elements[ 2 ].BrushObject.Color1 := colors[ 3 ]
Gui1.Clear()
Gdip_DrawImage( Gui1.G , pBitmap := CursorHighlight1Function( Gui1.Elements ) , 0 , 0 , Gui1.W , Gui1.H )
Gdip_DisposeImage( pBitmap )
Gui1.Update()
}
}
;**************************************( Cursor Highlight 1 )*********************************************
CursorHighlight1Elements(){
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "DrawEllipse" , Rect: { X: 25 + 0 , Y: 25 + 0 , W: 50 , H: 50 } , Thickness: "7" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0x99880000" } } )
Elements.Push( { Index: 2 , Layer: 1 , ElementType: "DrawEllipse" , Rect: { X: 25 + 0 , Y: 25 + 0 , W: 50 , H: 50 } , Thickness: "3" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 3 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 50 + 0 , Y: 5 + 0 } , EndVector: { X: 50 + 0 , Y: 30 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 4 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 5 + 0 , Y: 50 + 0 } , EndVector: { X: 30 + 0 , Y: 50 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 5 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 50 + 0 , Y: 95 + 0 } , EndVector: { X: 50 + 0 , Y: 70 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 6 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 95 + 0 , Y: 50 + 0 } , EndVector: { X: 70 + 0 , Y: 50 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
return Elements
}
;******************************************************************************************************
CursorHighlight1Function( Elements , Scale := 1 , returnType := "pBitmap" ){
local pBitmap := Gdip_CreateBitmap( 100 * Scale , 100 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 2 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 3 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 4 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 5 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 6 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
Bitmap maker data: .
*Fixed the leak*
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Cursor Highlight /w Utility Tool
*Requires Windows 8 or higher.
Press ctrl + alt + RButton [Keep holding RButton down]
While holding down RButton, Left click [LButton] on one of the 4 triangles to do the action assigned to it.
. .
Editor Data:
*Requires Windows 8 or higher.
Press ctrl + alt + RButton [Keep holding RButton down]
While holding down RButton, Left click [LButton] on one of the 4 triangles to do the action assigned to it.
. .
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
#Include <HB Vectors v3> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132770&p=583213#p583213
#Include <PopUpWindow v4_1> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132744&p=583099#p583097
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
pToken := Gdip_Startup()
Settings := {}
Settings.Options := "+AlwaysOnTop -DPIScale +ToolWindow +Owner +E0x20"
Settings.Rect := { X: 500 , Y: 130 , W: 100 , H: 100 }
Gui1 := PopupWindow_v4( Settings )
Gui1.Elements := CursorHighlight2Elements()
;*************
Loop( 4 ){
cc := Gui1.Elements[ 6 + A_Index ]
x := cc.StartVector.X - cc.Radius
y := cc.StartVector.Y - cc.Radius
w := cc.Radius * 2
h := cc.Radius * 2
Gui1.Window.Add( "Text" , "x" x " y" y " w" w " h" h ).OnEvent( "Click" , Do_Action_%A_Index%.Bind( Gui1 ) )
}
;*************
Gui1.UpdateTimer := UpdateCursor.Bind( Gui1 )
SetTimer( Gui1.UpdateTimer , 30 )
;##############################################
*^ESC::ExitApp ;<<<---- Set Exit Hotkey
;##############################################
^!RButton::
{
SetTimer( Gui1.UpdateTimer , 0 )
Sleep( 30 )
Gui1.Window.Opt( "-E0x20" )
Gui1.Window.Show("NA")
colors := [ "0xFFFF0000" , "0xFFFFFF00" , "0xFF00FF00" , "0xFF0000FF" ]
Loop( 4 ){
Gui1.Elements[ A_Index + 2 ].Color1 := 0x99FF0000
Gui1.Elements[ A_Index + 2 ].Color2 := 0x99880000
Gui1.Elements[ A_Index + 6 ].Color1 := colors[ A_Index ]
Gui1.Elements[ A_Index + 6 ].Color2 := "0xFF880000"
}
Gui1.Elements[ 2 ].BrushObject.Color1 := 0x99FF0000
Gui1.Clear()
Gdip_DrawImage( Gui1.G , pBitmap := CursorHighlight2Function( Gui1.Elements ) , 0 , 0 , Gui1.W , Gui1.H )
Gdip_DisposeImage( pBitmap )
Gui1.Update()
While( GetKeyState( "RButton" , "P" ) )
Sleep( 30 )
Gui1.Window.Opt( "+E0x20" )
SetTimer( Gui1.UpdateTimer , 30 )
}
;##############################################
Do_Action_1( Gui1 , * ){
Run( "Calc.Exe" )
}
Do_Action_2( Gui1 , * ){
ToolTip( "Hello`nWorld")
Sleep( 2000 )
ToolTip()
}
Do_Action_3( Gui1 , * ){
MsgBox( "Action 3")
}
Do_Action_4( Gui1 , * ){
SoundBeep( 555 )
SoundBeep( 999 )
SoundBeep( 1555 )
}
;##############################################
UpdateCursor( Gui1 , * ){
static LastState := ""
static LastPosition := Vector( 1 , 1 )
local currentState := 0
local pBitmap := "" , colors := ""
local MouseVector := Vector.MouseVector()
MouseVector.Add( -50 , -50 )
if( GetKeyState( "LButton" ) )
currentState := 1
if( GetKeyState( "RButton" ) )
currentState := 2
if( LastPosition.Dist( MouseVector ) > 1 || currentState != LastState ){
LastPosition := MouseVector.Clone()
LastState := currentState
Gui1.Resize( 1 , MouseVector )
switch currentState {
case 0: colors := [ "0x00000000" , "0x00000000" , "0xFF000000" ]
case 1: colors := [ "0x99FFFF00" , "0x99880000" , "0x99FFFF00" ]
case 2: colors := [ "0x99FF0000" , "0x99880000" , "0x99FF0000" ]
}
Loop( 4 ){
Gui1.Elements[ A_Index + 2 ].Color1 := colors[ 1 ]
Gui1.Elements[ A_Index + 2 ].Color2 := colors[ 2 ]
Gui1.Elements[ A_Index + 6 ].Color1 := "0x00000000"
Gui1.Elements[ A_Index + 6 ].Color2 := "0x00000000"
}
Gui1.Elements[ 2 ].BrushObject.Color1 := colors[ 3 ]
Gui1.Clear()
Gdip_DrawImage( Gui1.G , pBitmap := CursorHighlight2Function( Gui1.Elements ) , 0 , 0 , Gui1.W , Gui1.H )
Gdip_DisposeImage( pBitmap )
Gui1.Update()
}
}
;**************************************( Cursor Highlight 2 )*********************************************
CursorHighlight2Elements(){
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "DrawEllipse" , Rect: { X: 25 + 0 , Y: 25 + 0 , W: 50 , H: 50 } , Thickness: "7" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF880000" } } )
Elements.Push( { Index: 2 , Layer: 1 , ElementType: "DrawEllipse" , Rect: { X: 25 + 0 , Y: 25 + 0 , W: 50 , H: 50 } , Thickness: "3" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 3 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 50 + 0 , Y: 5 + 0 } , EndVector: { X: 50 + 0 , Y: 30 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 4 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 5 + 0 , Y: 50 + 0 } , EndVector: { X: 30 + 0 , Y: 50 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 5 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 50 + 0 , Y: 95 + 0 } , EndVector: { X: 50 + 0 , Y: 70 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 6 , Layer: 1 , ElementType: "DrawArrow" , StartVector: { X: 95 + 0 , Y: 50 + 0 } , EndVector: { X: 70 + 0 , Y: 50 + 0 } , HeadLength: "15" , NeckLength: "0" , ArmLength: "8" , ElbowLength: "3" , Thickness: "2" , Color1: "0xFFFFFF00" , Color2: "0xFF800000" , Note: "" } )
Elements.Push( { Index: 7 , Layer: 2 , ElementType: "BorderedSimplePolygon" , StartVector: { X: 10 + 0 , Y: 10 + 0 } , Radius: 10 , Sides: 3 , StartAngle: 350 , Thickness: 2 , Color1: 0xffff0000 , Color2: 0xff800000 , Note: "" } )
Elements.Push( { Index: 8 , Layer: 2 , ElementType: "BorderedSimplePolygon" , StartVector: { X: 90 + 0 , Y: 10 + 0 } , Radius: 10 , Sides: 3 , StartAngle: 310 , Thickness: 2 , Color1: 0xffFFFF00 , Color2: 0xff800000 , Note: "" } )
Elements.Push( { Index: 9 , Layer: 2 , ElementType: "BorderedSimplePolygon" , StartVector: { X: 90 + 0 , Y: 90 + 0 } , Radius: 10 , Sides: 3 , StartAngle: 290 , Thickness: 2 , Color1: 0xff00FF00 , Color2: 0xff800000 , Note: "" } )
Elements.Push( { Index: 10 , Layer: 2 , ElementType: "BorderedSimplePolygon" , StartVector: { X: 10 + 0 , Y: 90 + 0 } , Radius: 10 , Sides: 3 , StartAngle: 260 , Thickness: 2 , Color1: 0xff0000FF , Color2: 0xff800000 , Note: "" } )
return Elements
}
CursorHighlight2Function( Elements , Scale := 1 , returnType := "pBitmap" ){
local pBitmap := Gdip_CreateBitmap( 100 * Scale , 100 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 2 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 3 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 4 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 5 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 6 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
ev := Vector( element.EndVector )
ev.Mult( scale )
arrow := Vector.Arrow( sv , ev , element.HeadLength * scale , element.NeckLength * scale , element.ArmLength * scale , element.ElbowLength * scale )
Gdip_FillPolygon( pGraphics , pBrush , arrow )
Gdip_DrawLines( pGraphics , pPen , arrow )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
;Layer: 2
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 7 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
shape := Vector.PolygonShape( sv , element.Radius * scale , element.Sides , element.StartAngle )
shape .= "|" StrSplit( shape , "|" )[2]
Gdip_DrawLines( pGraphics , pPen , shape )
Gdip_FillPolygon( pGraphics , pBrush , shape )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 8 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
shape := Vector.PolygonShape( sv , element.Radius * scale , element.Sides , element.StartAngle )
shape .= "|" StrSplit( shape , "|" )[2]
Gdip_DrawLines( pGraphics , pPen , shape )
Gdip_FillPolygon( pGraphics , pBrush , shape )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 9 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
shape := Vector.PolygonShape( sv , element.Radius * scale , element.Sides , element.StartAngle )
shape .= "|" StrSplit( shape , "|" )[2]
Gdip_DrawLines( pGraphics , pPen , shape )
Gdip_FillPolygon( pGraphics , pBrush , shape )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
element := Elements[ 10 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
shape := Vector.PolygonShape( sv , element.Radius * scale , element.Sides , element.StartAngle )
shape .= "|" StrSplit( shape , "|" )[2]
Gdip_DrawLines( pGraphics , pPen , shape )
Gdip_FillPolygon( pGraphics , pBrush , shape )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
v2.2.9
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.9
Fixed an issue where the DrawImage element type wasn't automatically updating the layer after selecting the image path, this was due to the fact that unlike other element types, the image type has the prototype object created and then edited after. Since the normal action is to create the element and draw it at the same time, there's nothing to draw in the case of the image until later.
-Layers now include a copy of a pBitmap.
-Added BlurImage Element Type.
BlurImage
. . . .
Blur Image is not intended for code output functions. You can save the data so that the editor can reload your project but there is no code for this in the output function. Use Blur Image only when you intend to save a .PNG
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.9
Fixed an issue where the DrawImage element type wasn't automatically updating the layer after selecting the image path, this was due to the fact that unlike other element types, the image type has the prototype object created and then edited after. Since the normal action is to create the element and draw it at the same time, there's nothing to draw in the case of the image until later.
-Layers now include a copy of a pBitmap.
-Added BlurImage Element Type.
BlurImage
. . . .
Blur Image is not intended for code output functions. You can save the data so that the editor can reload your project but there is no code for this in the output function. Use Blur Image only when you intend to save a .PNG
- Komrad Toast
- Posts: 85
- Joined: 28 Jun 2024, 02:19
- Contact:
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
@Hellbent
This looks absolutely fantastic! Great job on this!
This looks absolutely fantastic! Great job on this!
My Projects (link to GitHub)
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
@Hellbent
The bless of the community
The bless of the community
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
v2.2.10 Nov 15th 2024
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.10
-Added the ability to record/take screen caps of a region of the screen.
How To Record
. . .
If you change the selected project it will need to be locked again to use some of the features. i.e. You can only do things like take a screen cap if you have a project locked and changing between projects unlocks them.
Playback is done in the bitmap editor.
There is an example at around line 89 that shows how to set up a loop or timer to automatically take shots.
Thank you @songdg.
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.10
-Added the ability to record/take screen caps of a region of the screen.
How To Record
. . .
If you change the selected project it will need to be locked again to use some of the features. i.e. You can only do things like take a screen cap if you have a project locked and changing between projects unlocks them.
Playback is done in the bitmap editor.
There is an example at around line 89 that shows how to set up a loop or timer to automatically take shots.
Thank you @songdg.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
@Hellbent
You just keep me amazing, well done!
You just keep me amazing, well done!
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
v2.2.11
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.11
-Added an "extended" output format. Choose "Extended" to have the "elements" separated into another function (easy mode dynamic graphics).
-Added Trigger Element Types
-Added a Windows Message Event Class.
You can now add 4 different types of "Trigger" Elements to a bitmap.
The "Triggers" generate 2 output functions.
The first creates an object that is passed to the events class.
The second is used as the callback for trigger events.
Here is an example of the generated code to create the trigger object.
This creates a "TriggerWindow".
And here is the generated code for the callback function.
This is set to monitor Hover and Click events (Acts as a button)
Included with the last code is a commented example of how to add the "trigger" to the events class (the name of the events class is "EventsClass").
;EventsClass.AddTrigger( Trigger1Object( parent , Vector( 0 , 0 ) ) )
You pass the parent window object (i.e. "Gui1" is the parent object in the following: Gui1 := Gui() ) and a vector to use as an offset for all trigger positions.
Example: If the bitmap is drawn in a picture control, you use the x and y of the picture control as the offset.
. .
You can press the "Clip Events" button on the editor to clipboard a copy of the events class to be pasted in a scrip.
Included in the generated code is a commented "#Include" for the EventsClass. If you save a copy of the EventsClass in your ahk lib folder, you only have to deal with adding the class once, after that you can just uncomment the "#Include" that comes with the generated code.
Here is the name I have given to the EventsClass you will need to save it in your ahk lib with the same name to get the most out of the prewritten code.
#Include <HB Bitmap Events v1.1> ;This is found in the editor
This is what the element panel for the triggers looks like.
. .
If you leave the name and callback with the default name Trigger, the output code will add the triggers index to the name so that it has a unique name and function names. i.e. You don't have to change the names if you are ok with the output calling the triggers "Trigger1", "Trigger2", etc.
There are 4 different types of triggers.
-Window
-Control
-Rectangle
-Vector
All 4 types share the same message list and most other options.
Two of the trigger types can be used as "Buttons", they are the TriggerWindow and TriggerControl.
These two "triggers" are created using their namesake, so the TriggerWindow is a child window that is set to intercept window messages, and a "TriggerControl" is a control that is set to monitor window messages.
The remaining two trigger types are purely spatial and although they can be made to act like a button, it isn't the default setup for them.
Triggers can be set to monitor actions that happen inside and actions that happen outside or both, they can also be toggled by changing a variable value.
When a trigger is created in the editor, you select which messages you want to monitor with that trigger.
There are currently 10 messages that you can monitor and each is represented with an object that has 3 properties (4 props in the editor (The first is to add that message type to the output) ).
MouseMove := { State: True , Inside: True , Outside: False }
-State: Turn on or off this message type for this trigger.
If the State is set to false or 0 the event class will ignore this message type for this trigger.
-Inside: Turn on or off messages that occur on the inside area of the trigger. (Inside the Rectangle or circle/[Vector] of a trigger)
-Outside: Turn on or off messages that occur outside of the trigger area.
To make a TriggerWindow or TriggerControl act as a button with hover, set the "Isbutton" checkbox and the "MouseMove" checkbox.
The event class deals with trigger events based on the type of trigger (window, control, rectangle, and vector)
"Outside" actions happen first and these events don't stop other actions from happening.
"Rectangle" and "Vector" triggers happen after outside actions and like with the outside actions they don't interfere with other trigger events.
This means that you can stack "Rectangle" and "Vector" triggers on top of other triggers. The order they will follow is the order the trigger is added to the event class.
"TriggerControl" and "TriggerWindow" events are handled last and they stop any further actions from happening for the same instance of the window message. i.e. If a "Control" or "Window" is triggered it will return 0
--------------------------------
Here is an example of using "Triggers" in the editor and a script.
. .
Example Script:
Bitmap Editor Data:
Name: Camera 2 with Triggers.ini
Thank you @songdg
*Edit* Fixed a possible problem with DPI scaling and the "Clip Events" button.
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.11
-Added an "extended" output format. Choose "Extended" to have the "elements" separated into another function (easy mode dynamic graphics).
-Added Trigger Element Types
-Added a Windows Message Event Class.
You can now add 4 different types of "Trigger" Elements to a bitmap.
The "Triggers" generate 2 output functions.
The first creates an object that is passed to the events class.
The second is used as the callback for trigger events.
Here is an example of the generated code to create the trigger object.
This creates a "TriggerWindow".
Code: Select all
;------------------------------------------------------------------------------------------------------
Trigger1Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger1"
trigger.Type := "Window"
trigger.Parent := parent
trigger.IsButton := 1
if( IsObject( offsetVector ) )
trigger.Rect := { X: ( 10 + offsetVector.X ) * Scale , Y: ( 10 + offsetVector.Y ) * Scale , W: 490 * Scale , H: 280 * Scale }
else
trigger.Rect := { X: 10 * Scale , Y: 10 * Scale , W: 490 * Scale , H: 280 * Scale }
trigger.Note := "This is the first use of a trigger in an actual script."
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.LButtonDown := { State: 1 , Msg: 0x0201 , Inside: 1 , Outside: 0 }
trigger.LButtonUp := { State: 1 , Msg: 0x0202 , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger1.Bind( trigger )
trigger.Window := PopupWindow_V4( { Options: "-DPIScale +Parent" parent.Hwnd , Rect: { X: trigger.Rect.X , Y: trigger.Rect.Y , W: trigger.Rect.W , H: trigger.Rect.H } } )
if( backcolor != "" )
trigger.Window.Clear( 1 , backcolor )
else
trigger.Window.Clear( 1 , "0x01000000" )
trigger.Window.Update()
return trigger
}
;------------------------------------------------------------------------------------------------------
This is set to monitor Hover and Click events (Acts as a button)
Code: Select all
;EventsClass.AddTrigger( Trigger1Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger1 )*****************************************************
Trigger1( trigger , info ){
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x02A1: ;Hover On
case 0x02A3: ;Hover Off
case 0x0201: ;LButtonDown
case 0x0202: ;LButtonUp
default:
}
}
}
;------------------------------------------------------------------------------------------------------
;EventsClass.AddTrigger( Trigger1Object( parent , Vector( 0 , 0 ) ) )
You pass the parent window object (i.e. "Gui1" is the parent object in the following: Gui1 := Gui() ) and a vector to use as an offset for all trigger positions.
Example: If the bitmap is drawn in a picture control, you use the x and y of the picture control as the offset.
. .
You can press the "Clip Events" button on the editor to clipboard a copy of the events class to be pasted in a scrip.
Included in the generated code is a commented "#Include" for the EventsClass. If you save a copy of the EventsClass in your ahk lib folder, you only have to deal with adding the class once, after that you can just uncomment the "#Include" that comes with the generated code.
Here is the name I have given to the EventsClass you will need to save it in your ahk lib with the same name to get the most out of the prewritten code.
#Include <HB Bitmap Events v1.1> ;This is found in the editor
This is what the element panel for the triggers looks like.
. .
If you leave the name and callback with the default name Trigger, the output code will add the triggers index to the name so that it has a unique name and function names. i.e. You don't have to change the names if you are ok with the output calling the triggers "Trigger1", "Trigger2", etc.
There are 4 different types of triggers.
-Window
-Control
-Rectangle
-Vector
All 4 types share the same message list and most other options.
Two of the trigger types can be used as "Buttons", they are the TriggerWindow and TriggerControl.
These two "triggers" are created using their namesake, so the TriggerWindow is a child window that is set to intercept window messages, and a "TriggerControl" is a control that is set to monitor window messages.
The remaining two trigger types are purely spatial and although they can be made to act like a button, it isn't the default setup for them.
Triggers can be set to monitor actions that happen inside and actions that happen outside or both, they can also be toggled by changing a variable value.
When a trigger is created in the editor, you select which messages you want to monitor with that trigger.
There are currently 10 messages that you can monitor and each is represented with an object that has 3 properties (4 props in the editor (The first is to add that message type to the output) ).
MouseMove := { State: True , Inside: True , Outside: False }
-State: Turn on or off this message type for this trigger.
If the State is set to false or 0 the event class will ignore this message type for this trigger.
-Inside: Turn on or off messages that occur on the inside area of the trigger. (Inside the Rectangle or circle/[Vector] of a trigger)
-Outside: Turn on or off messages that occur outside of the trigger area.
To make a TriggerWindow or TriggerControl act as a button with hover, set the "Isbutton" checkbox and the "MouseMove" checkbox.
The event class deals with trigger events based on the type of trigger (window, control, rectangle, and vector)
"Outside" actions happen first and these events don't stop other actions from happening.
"Rectangle" and "Vector" triggers happen after outside actions and like with the outside actions they don't interfere with other trigger events.
This means that you can stack "Rectangle" and "Vector" triggers on top of other triggers. The order they will follow is the order the trigger is added to the event class.
"TriggerControl" and "TriggerWindow" events are handled last and they stop any further actions from happening for the same instance of the window message. i.e. If a "Control" or "Window" is triggered it will return 0
--------------------------------
Here is an example of using "Triggers" in the editor and a script.
. .
Example Script:
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
#Warn All, Off
;******************************************************************************************************
#Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
#Include <PopUpWindow v4_1> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132744&p=583099#p583097
#Include <HB Vectors v3> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132770&p=583213#p583213
#Include <HB Bitmap Events v1.1> ;This is found in the editor
pToken := Gdip_Startup()
;**************************************( Triggers 2 )*********************************************
( ( Gui1 := Gui( "+AlwaysOnTop +E0x02000000 +E0x00080000" ) ).OnEvent( "Close" , GuiClose ) )
Gui1.MarginX := 0 , Gui1.MarginY := 0
EventsClass.AddTrigger( Trigger5Object( Gui1 , Vector( 0 , 0 ) ,, "0xFF3399ff" ) ) ;<<-- Added before the picture control so that it is visable.
Gui1.Elements := Carara2withtriggersElements()
Gui1.Pic1 := Gui1.Add( "Picture" , "xm ym w432 h364 Disabled" , "hBitmap: " Carara2withtriggersFunction( Gui1.Elements ) )
Gui1.Show( "w432 h364" )
EventsClass.AddTrigger( Trigger1Object( Gui1 , Vector( 0 , 0 ) , , "22262a" ) )
EventsClass.AddTrigger( Trigger2Object( Gui1 , Vector( 0 , 0 ) ) )
EventsClass.AddTrigger( Trigger3Object( Gui1 , Vector( 0 , 0 ) ) )
EventsClass.AddTrigger( Trigger4Object( Gui1 , Vector( 0 , 0 ) ) )
; EventsClass.AddTrigger( Trigger5Object( Gui1 , Vector( 0 , 0 ) ,, "0xFF3399ff" ) ) ;<<<--- This was added before the picture so that the trigger window is also visable.
*ESC::ExitApp
GuiClose(*){
ExitApp
}
;----------------
TimedTips( msg , time := 1500 ){
ToolTip( msg )
SetTimer( TipOff , Abs( time ) * -1 )
return 0
}
TipOff(*){
ToolTip()
}
;----------------
;The code after this line was generated by the editor. Only the trigger callback functions need to be edited after it is generated, all other code can sit in another file and #included for all it really matters.
;******************************************************************************************************
; #Include <GDIP_ALL V2> ;https://raw.githubusercontent.com/buliasz/AHKv2-Gdip/master/Gdip_All.ahk
; #Include <PopUpWindow v4_1> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132744&p=583099#p583097
; #Include <HB Vectors v3> ;https://www.autohotkey.com/boards/viewtopic.php?f=83&t=132770&p=583213#p583213
; #Include <HB Bitmap Events v1.1> ;This is found in the editor
; pToken := Gdip_Startup()
;**************************************( Carara 2 with triggers )*********************************************
Carara2withtriggersElements(){
local Elements := []
Elements.Push( { Index: 1 , Layer: 1 , ElementType: "BorderedSimplePolygon" , StartVector: { X: 212 + 0 , Y: 86 + 0 } , Radius: 78 , Sides: 6 , StartAngle: 60 , Thickness: 14 , Color1: 0xFF766E6E , Color2: 0xFF000000 , Note: "" } )
Elements.Push( { Index: 2 , Layer: 2 , ElementType: "FillRectangle" , Rect: { X: 47 + 0 , Y: 43 + 0 , W: 56 , H: 50 } , Roundness: 10 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFB4ACB5" } } )
Elements.Push( { Index: 3 , Layer: 2 , ElementType: "FillRectangle" , Rect: { X: 320 + 0 , Y: 52 + 0 , W: 56 , H: 50 } , Roundness: 10 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFB4ACB5" } } )
Elements.Push( { Index: 4 , Layer: 2 , ElementType: "DrawRectangle" , Rect: { X: 320 + 0 , Y: 52 + 0 , W: 56 , H: 50 } , Roundness: 7 , Thickness: 9 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 5 , Layer: 2 , ElementType: "DrawRectangle" , Rect: { X: 47 + 0 , Y: 43 + 0 , W: 56 , H: 50 } , Roundness: 7 , Thickness: 9 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 6 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 18 + 0 , Y: 80 + 0 , W: 385 , H: 260 } , Roundness: 20 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF766E6E" } } )
Elements.Push( { Index: 7 , Layer: 3 , ElementType: "DrawRectangle" , Rect: { X: 36 + 0 , Y: 100 + 0 , W: 351 , H: 224 } , Roundness: 10 , Thickness: 19 , Note: "" , BrushObject: { BrushType: "GradientBrush" , Rect: { X: 40 , Y: 100 , W: 340 , H: 220 } , Color1: "0x44F2EFF2" , Color2: "0x44000000" , LinearGradientMode: "2" , GradientBrushWrapMode: "1" } } )
Elements.Push( { Index: 8 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 20 + 0 , Y: 80 + 0 , W: 380 , H: 260 } , Roundness: 20 , Note: "" , BrushObject: { BrushType: "GradientBrush" , Rect: { X: 20 , Y: 80 , W: 380 , H: 260 } , Color1: "0x00336699" , Color2: "0x66000000" , LinearGradientMode: "2" , GradientBrushWrapMode: "1" } } )
Elements.Push( { Index: 9 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 20 + 0 , Y: 80 + 0 , W: 380 , H: 80 } , Roundness: 9 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFCAC3CB" } } )
Elements.Push( { Index: 10 , Layer: 3 , ElementType: "DrawRectangle" , Rect: { X: 18 + 0 , Y: 80 + 0 , W: 385 , H: 260 } , Roundness: 20 , Thickness: 13 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 11 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 50 + 0 , Y: 100 + 0 , W: 63 , H: 33 } , Roundness: 0 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFF2EFF2" } } )
Elements.Push( { Index: 12 , Layer: 3 , ElementType: "DrawRectangle" , Rect: { X: 50 + 0 , Y: 100 + 0 , W: 63 , H: 33 } , Roundness: 6 , Thickness: 9 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 13 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 336 + 0 , Y: 101 + 0 , W: 27 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 14 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 320 + 0 , Y: 125 + 0 , W: 44 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 15 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 335 + 0 , Y: 237 + 0 , W: 36 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 16 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 41 + 0 , Y: 209 + 0 , W: 52 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 17 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 41 + 0 , Y: 185 + 0 , W: 86 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 18 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 20 + 0 , Y: 155 + 0 , W: 384 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 19 , Layer: 3 , ElementType: "FillRectangle" , Rect: { X: 180 + 0 , Y: 35 + 0 , W: 64 , H: 13 } , Roundness: 6 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 20 , Layer: 4 , ElementType: "FillEllipse" , Rect: { X: 118 + 0 , Y: 125 + 0 , W: 191 , H: 191 } , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFF2EFF2" } } )
Elements.Push( { Index: 21 , Layer: 4 , ElementType: "DrawEllipse" , Rect: { X: 118 + 0 , Y: 125 + 0 , W: 191 , H: 191 } , Thickness: "10" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 22 , Layer: 4 , ElementType: "FillEllipse" , Rect: { X: 148 + 0 , Y: 155 + 0 , W: 131 , H: 131 } , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF62DAFA" } } )
Elements.Push( { Index: 23 , Layer: 4 , ElementType: "FillEllipse" , Rect: { X: 148 + 0 , Y: 155 + 0 , W: 111 , H: 121 } , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF98E5FB" } } )
Elements.Push( { Index: 24 , Layer: 4 , ElementType: "DrawEllipse" , Rect: { X: 148 + 0 , Y: 155 + 0 , W: 131 , H: 131 } , Thickness: "10" , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
Elements.Push( { Index: 25 , Layer: 4 , ElementType: "FillRectangle" , Rect: { X: 319 + 0 , Y: 270 + 0 , W: 50 , H: 33 } , Roundness: 10 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFFE0D2CD" } } )
Elements.Push( { Index: 26 , Layer: 4 , ElementType: "DrawRectangle" , Rect: { X: 319 + 0 , Y: 270 + 0 , W: 50 , H: 33 } , Roundness: 9 , Thickness: 10 , Note: "" , BrushObject: { BrushType: "SolidBrush" , Color1: "0xFF000000" } } )
return Elements
}
;******************************************************************************************************
Carara2withtriggersFunction( Elements , Scale := 1 , returnType := "hBitmap" ){
local pBitmap := Gdip_CreateBitmap( 432 * Scale , 364 * Scale )
local pGraphics := Gdip_GraphicsFromImage( pBitmap )
;Layer: 1
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 1 ]
pBrush := Gdip_BrushCreateSolid( element.Color1 )
pPen := Gdip_CreatePen( element.Color2 , element.Thickness * scale )
sv := Vector( element.StartVector )
sv.Mult( scale )
shape := Vector.PolygonShape( sv , element.Radius * scale , element.Sides , element.StartAngle )
shape .= "|" StrSplit( shape , "|" )[2]
Gdip_DrawLines( pGraphics , pPen , shape )
Gdip_FillPolygon( pGraphics , pBrush , shape )
Gdip_DeletePen( pPen )
Gdip_DeleteBrush( pBrush )
;Layer: 2
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 2 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 3 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 4 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
element := Elements[ 5 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
;Layer: 3
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 6 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 7 ] , Brush := element.BrushObject
pBrush := Gdip_CreateLineBrushFromRect( Brush.Rect.X , Brush.Rect.Y , Brush.Rect.W , Brush.Rect.H , Brush.Color1 , Brush.Color2 , Brush.LinearGradientMode , Brush.GradientBrushWrapMode ) , pPen := Gdip_CreatePenFromBrush( pBrush , element.Thickness * scale ) , Gdip_DeleteBrush( pBrush )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
element := Elements[ 8 ] , Brush := element.BrushObject
pBrush := Gdip_CreateLineBrushFromRect( Brush.Rect.X , Brush.Rect.Y , Brush.Rect.W , Brush.Rect.H , Brush.Color1 , Brush.Color2 , Brush.LinearGradientMode , Brush.GradientBrushWrapMode )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 9 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 10 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
element := Elements[ 11 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 12 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
element := Elements[ 13 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 14 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 15 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 16 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 17 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 18 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 19 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
;Layer: 4
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
element := Elements[ 20 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillEllipse( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 21 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 22 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillEllipse( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 23 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillEllipse( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 24 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawEllipse( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
Gdip_DeletePen( pPen )
element := Elements[ 25 ] , Brush := element.BrushObject
pBrush := Gdip_BrushCreateSolid( Brush.Color1 )
Gdip_FillRoundedRectangle( pGraphics , pBrush , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeleteBrush( pBrush )
element := Elements[ 26 ] , Brush := element.BrushObject
pPen := Gdip_CreatePen( Brush.Color1 , element.Thickness * scale )
Gdip_DrawRoundedRectangle( pGraphics , pPen , ( element.Rect.X ) * scale , ( element.Rect.Y ) * scale , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale , element.Roundness * scale )
Gdip_DeletePen( pPen )
;Layer: 5
Gdip_SetSmoothingMode( pGraphics , 2 ) , Gdip_SetInterpolationMode( pGraphics , 7 )
Gdip_DeleteGraphics( pGraphics )
if( returnType = "hBitmap" ){
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage( pBitmap )
return hBitmap
}
return pBitmap
}
;******************************************************************************************************
;EventsClass.AddTrigger( Trigger1Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger1 )*****************************************************
Trigger1( trigger , info ){
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x02A1: ;Hover On
TimedTips( "Hover")
case 0x02A3: ;Hover Off
default:
}
}
}
;------------------------------------------------------------------------------------------------------
Trigger1Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger1"
trigger.Type := "Control"
trigger.Parent := parent
trigger.IsButton := 1
if( IsObject( offsetVector ) )
trigger.Rect := { X: ( 48 + offsetVector.X ) * Scale , Y: ( 96 + offsetVector.Y ) * Scale , W: 66 * Scale , H: 40 * Scale }
else
trigger.Rect := { X: 48 * Scale , Y: 96 * Scale , W: 66 * Scale , H: 40 * Scale }
trigger.Note := ""
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger1.Bind( trigger )
winType := ( parent.HasProp( "HBM" ) ) ? ( parent.Window ) : ( parent )
if( backcolor != "" )
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " Background" backcolor )
else{
try{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " BackgroundTrans" )
}catch{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H )
}
}
return trigger
}
;------------------------------------------------------------------------------------------------------
;EventsClass.AddTrigger( Trigger2Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger2 )*****************************************************
Trigger2( trigger , info ){
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x02A1: ;Hover On
case 0x02A3: ;Hover Off
case 0x0201: ;LButtonDown
default:
}
}
}
;------------------------------------------------------------------------------------------------------
Trigger2Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger2"
trigger.Type := "Control"
trigger.Parent := parent
trigger.IsButton := 1
if( IsObject( offsetVector ) )
trigger.Rect := { X: ( 322 + offsetVector.X ) * Scale , Y: ( 53 + offsetVector.Y ) * Scale , W: 52 * Scale , H: 24 * Scale }
else
trigger.Rect := { X: 322 * Scale , Y: 53 * Scale , W: 52 * Scale , H: 24 * Scale }
trigger.Note := ""
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.LButtonDown := { State: 1 , Msg: 0x0201 , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger2.Bind( trigger )
winType := ( parent.HasProp( "HBM" ) ) ? ( parent.Window ) : ( parent )
if( backcolor != "" )
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " Background" backcolor )
else{
try{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " BackgroundTrans" )
}catch{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H )
}
}
return trigger
}
;------------------------------------------------------------------------------------------------------
;EventsClass.AddTrigger( Trigger3Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger3 )*****************************************************
Trigger3( trigger , info ){
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x0200: ;MouseMove
TimedTips( "Hover")
case 0x0201: ;LButtonDown
default:
}
}
}
;------------------------------------------------------------------------------------------------------
Trigger3Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger3"
trigger.Type := "Control"
trigger.Parent := parent
trigger.IsButton := 0
if( IsObject( offsetVector ) )
trigger.Rect := { X: ( 322 + offsetVector.X ) * Scale , Y: ( 273 + offsetVector.Y ) * Scale , W: 45 * Scale , H: 27 * Scale }
else
trigger.Rect := { X: 322 * Scale , Y: 273 * Scale , W: 45 * Scale , H: 27 * Scale }
trigger.Note := ""
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.LButtonDown := { State: 1 , Msg: 0x0201 , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger3.Bind( trigger )
winType := ( parent.HasProp( "HBM" ) ) ? ( parent.Window ) : ( parent )
if( backcolor != "" )
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " Background" backcolor )
else{
try{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H " BackgroundTrans" )
}catch{
trigger.Control := winType.Add( "Progress" , "x" trigger.Rect.X " y" trigger.Rect.Y " w" trigger.Rect.W " h" trigger.Rect.H )
}
}
return trigger
}
;------------------------------------------------------------------------------------------------------
;EventsClass.AddTrigger( Trigger4Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger4 )*****************************************************
Trigger4( trigger , info ){
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x0200: ;MouseMove
case 0x020A: ;WheelChange
if( EventsClass.Direction ){
trigger.parent.Elements[ 22 ].BrushObject.Color1 := PopupWindow_v4.Colors[ Random( 1 , 16 ) ]
trigger.parent.Elements[ 23 ].BrushObject.Color1 := PopupWindow_v4.Colors[ Random( 1 , 16 ) ]
trigger.parent.Pic1.Value := "hBitmap: " Carara2withtriggersFunction( trigger.parent.Elements )
}else{
trigger.parent.Elements[ 22 ].BrushObject.Color1 := "0xFF62DAFA"
trigger.parent.Elements[ 23 ].BrushObject.Color1 := "0xFF98E5FB"
trigger.parent.Pic1.Value := "hBitmap: " Carara2withtriggersFunction( trigger.parent.Elements )
}
default:
}
}
}
;------------------------------------------------------------------------------------------------------
Trigger4Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger4"
trigger.Type := "Vector"
trigger.Parent := parent
if( IsObject( offsetVector ) )
trigger.Vector := Vector( ( 213 + offsetVector.X ) * scale , ( 222 + offsetVector.Y ) * scale )
else
trigger.Vector := Vector( 213 * scale , 222 * scale )
trigger.Radius := 66
trigger.Note := ""
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.WheelChange := { State: 1 , Msg: 0x020A , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger4.Bind( trigger )
return trigger
}
;------------------------------------------------------------------------------------------------------
;EventsClass.AddTrigger( Trigger5Object( parent , Vector( 0 , 0 ) ) )
;****************************************( Trigger5 )*****************************************************
Trigger5( trigger , info ){
static Index := 0
if( trigger.Outside ){
}else{
switch trigger.uMsg , "Off" {
case 0x02A1: ;Hover On
trigger.Window.Clear( 1 , Random( 1 , 16 ) )
case 0x02A3: ;Hover Off
trigger.Window.Clear( 1 , Random( 1 , 16 ) )
case 0x020A: ;WheelChange
if( EventsClass.Direction ){
TimedTips( ++Index )
}else{
TimedTips( --Index )
}
default:
}
}
}
;------------------------------------------------------------------------------------------------------
Trigger5Object( parent , offsetVector := "" , Scale := 1 , backcolor := "" ){
local trigger := {}
trigger.Name := "Trigger5"
trigger.Type := "Window"
trigger.Parent := parent
trigger.IsButton := 1
if( IsObject( offsetVector ) )
trigger.Rect := { X: ( 50 + offsetVector.X ) * Scale , Y: ( 47 + offsetVector.Y ) * Scale , W: 50 * Scale , H: 28 * Scale }
else
trigger.Rect := { X: 50 * Scale , Y: 47 * Scale , W: 50 * Scale , H: 28 * Scale }
trigger.Note := ""
trigger.MouseMove := { State: 1 , Msg: 0x0200 , Inside: 1 , Outside: 0 }
trigger.WheelChange := { State: 1 , Msg: 0x020A , Inside: 1 , Outside: 0 }
trigger.Callback := Trigger5.Bind( trigger )
trigger.Window := PopupWindow_V4( { Options: "-DPIScale +Parent" parent.Hwnd , Rect: { X: trigger.Rect.X , Y: trigger.Rect.Y , W: trigger.Rect.W , H: trigger.Rect.H } } )
if( backcolor != "" )
trigger.Window.Clear( 1 , backcolor )
else
trigger.Window.Clear( 1 , "0x01000000" )
trigger.Window.Update()
return trigger
}
;------------------------------------------------------------------------------------------------------
Name: Camera 2 with Triggers.ini
Code: Select all
[Bitmap Data]
Name=Carera 2 with triggers
Rect=322,251,432,364|
Smoothing=2
InterpolationMode=7
NumberOfLayers=5
IsHidden=0
Note=
Scale=1
[Layer 1 Data]
Name=Layer 3
Rect=0,0,432,364|
Smoothing=2
InterpolationMode=7
NumberOfElements=1
IsHidden=0
Note=
[Layer 1 Element 1 Data]
ElementType=BorderedSimplePolygon
StartVector=212,86
Radius=78
Sides=6
StartAngle=60
Thickness=14
Color1=0xFF766E6E
Color2=0xFF000000
IsHidden=0
Note=
[Layer 2 Data]
Name=Layer 4
Rect=0,0,432,364|
Smoothing=2
InterpolationMode=7
NumberOfElements=4
IsHidden=0
Note=
[Layer 2 Element 1 Data]
ElementType=FillRectangle
Rect=47,43,56,50|
IsHidden=0
Note=
Roundness=10
[Layer 2 Element 1 Brush Data]
BrushType=SolidBrush
Color1=0xFFB4ACB5
[Layer 2 Element 2 Data]
ElementType=FillRectangle
Rect=320,52,56,50|
IsHidden=0
Note=
Roundness=10
[Layer 2 Element 2 Brush Data]
BrushType=SolidBrush
Color1=0xFFB4ACB5
[Layer 2 Element 3 Data]
ElementType=DrawRectangle
Rect=320,52,56,50|
Roundness=7
Thickness=9
IsHidden=0
Note=
[Layer 2 Element 3 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 2 Element 4 Data]
ElementType=DrawRectangle
Rect=47,43,56,50|
Roundness=7
Thickness=9
IsHidden=0
Note=
[Layer 2 Element 4 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Data]
Name=Layer 2
Rect=0,0,432,364|
Smoothing=2
InterpolationMode=7
NumberOfElements=14
IsHidden=0
Note=
[Layer 3 Element 1 Data]
ElementType=FillRectangle
Rect=18,80,385,260|
IsHidden=0
Note=
Roundness=20
[Layer 3 Element 1 Brush Data]
BrushType=SolidBrush
Color1=0xFF766E6E
[Layer 3 Element 2 Data]
ElementType=DrawRectangle
Rect=36,100,351,224|
Roundness=10
Thickness=19
IsHidden=0
Note=
[Layer 3 Element 2 Brush Data]
BrushType=GradientBrush
Color1=0x44F2EFF2
Color2=0x44000000
Rect=40,100,340,220|
LinearGradientMode=2
GradientBrushWrapMode=1
[Layer 3 Element 3 Data]
ElementType=FillRectangle
Rect=20,80,380,260|
IsHidden=0
Note=
Roundness=20
[Layer 3 Element 3 Brush Data]
BrushType=GradientBrush
Color1=0x00336699
Color2=0x66000000
Rect=20,80,380,260|
LinearGradientMode=2
GradientBrushWrapMode=1
[Layer 3 Element 4 Data]
ElementType=FillRectangle
Rect=20,80,380,80|
IsHidden=0
Note=
Roundness=9
[Layer 3 Element 4 Brush Data]
BrushType=SolidBrush
Color1=0xFFCAC3CB
[Layer 3 Element 5 Data]
ElementType=DrawRectangle
Rect=18,80,385,260|
Roundness=20
Thickness=13
IsHidden=0
Note=
[Layer 3 Element 5 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 6 Data]
ElementType=FillRectangle
Rect=50,100,63,33|
IsHidden=0
Note=
Roundness=0
[Layer 3 Element 6 Brush Data]
BrushType=SolidBrush
Color1=0xFFF2EFF2
[Layer 3 Element 7 Data]
ElementType=DrawRectangle
Rect=50,100,63,33|
Roundness=6
Thickness=9
IsHidden=0
Note=
[Layer 3 Element 7 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 8 Data]
ElementType=FillRectangle
Rect=336,101,27,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 8 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 9 Data]
ElementType=FillRectangle
Rect=320,125,44,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 9 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 10 Data]
ElementType=FillRectangle
Rect=335,237,36,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 10 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 11 Data]
ElementType=FillRectangle
Rect=41,209,52,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 11 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 12 Data]
ElementType=FillRectangle
Rect=41,185,86,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 12 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 13 Data]
ElementType=FillRectangle
Rect=20,155,384,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 13 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 3 Element 14 Data]
ElementType=FillRectangle
Rect=180,35,64,13|
IsHidden=0
Note=
Roundness=6
[Layer 3 Element 14 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 4 Data]
Name=Layer 5
Rect=0,0,432,364|
Smoothing=2
InterpolationMode=7
NumberOfElements=7
IsHidden=0
Note=
[Layer 4 Element 1 Data]
ElementType=FillEllipse
Rect=118,125,191,191|
IsHidden=0
Note=
[Layer 4 Element 1 Brush Data]
BrushType=SolidBrush
Color1=0xFFF2EFF2
[Layer 4 Element 2 Data]
ElementType=DrawEllipse
Rect=118,125,191,191|
Thickness=10
IsHidden=0
Note=
[Layer 4 Element 2 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 4 Element 3 Data]
ElementType=FillEllipse
Rect=148,155,131,131|
IsHidden=0
Note=
[Layer 4 Element 3 Brush Data]
BrushType=SolidBrush
Color1=0xFF62DAFA
[Layer 4 Element 4 Data]
ElementType=FillEllipse
Rect=148,155,111,121|
IsHidden=0
Note=
[Layer 4 Element 4 Brush Data]
BrushType=SolidBrush
Color1=0xFF98E5FB
[Layer 4 Element 5 Data]
ElementType=DrawEllipse
Rect=148,155,131,131|
Thickness=10
IsHidden=0
Note=
[Layer 4 Element 5 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 4 Element 6 Data]
ElementType=FillRectangle
Rect=319,270,50,33|
IsHidden=0
Note=
Roundness=10
[Layer 4 Element 6 Brush Data]
BrushType=SolidBrush
Color1=0xFFE0D2CD
[Layer 4 Element 7 Data]
ElementType=DrawRectangle
Rect=319,270,50,33|
Roundness=9
Thickness=10
IsHidden=0
Note=
[Layer 4 Element 7 Brush Data]
BrushType=SolidBrush
Color1=0xFF000000
[Layer 5 Data]
Name=Triggers
Rect=0,0,432,364|
Smoothing=2
InterpolationMode=7
NumberOfElements=5
IsHidden=0
Note=
[Layer 5 Element 1 Data]
ElementType=TriggerControl
Name=Trigger
Type=Control
ControlType=Progress
Color1=0xFFFF0000
Rect=48,96,66,40|
Callback=Trigger
IsButton=1
DebugMode=1
MouseMove=1|1|1|0
LButtonDown=0|1|1|0
LButtonUp=0|1|1|0
LButtonDBLClick=0|1|1|0
RButtonDown=0|1|1|0
RButtonUp=0|1|1|0
RButtonDBLClick=0|1|1|0
WheelChange=0|1|1|0
KeyDown=0|1|1|0
KeyUp=0|1|1|0
Note=
IsHidden=0
[Layer 5 Element 2 Data]
ElementType=TriggerControl
Name=Trigger
Type=Control
ControlType=Progress
Color1=0xFFFF0000
Rect=322,53,52,24|
Callback=Trigger
IsButton=1
DebugMode=1
MouseMove=1|1|1|0
LButtonDown=1|1|1|0
LButtonUp=0|1|1|0
LButtonDBLClick=0|1|1|0
RButtonDown=0|1|1|0
RButtonUp=0|1|1|0
RButtonDBLClick=0|1|1|0
WheelChange=0|1|1|0
KeyDown=0|1|1|0
KeyUp=0|1|1|0
Note=
IsHidden=0
[Layer 5 Element 3 Data]
ElementType=TriggerControl
Name=Trigger
Type=Control
ControlType=Progress
Color1=0xFFFF0000
Rect=322,273,45,27|
Callback=Trigger
IsButton=0
DebugMode=1
MouseMove=1|1|1|0
LButtonDown=1|1|1|0
LButtonUp=0|1|1|0
LButtonDBLClick=0|1|1|0
RButtonDown=0|1|1|0
RButtonUp=0|1|1|0
RButtonDBLClick=0|1|1|0
WheelChange=0|1|1|0
KeyDown=0|1|1|0
KeyUp=0|1|1|0
Note=
IsHidden=0
[Layer 5 Element 4 Data]
ElementType=TriggerVector
Name=Trigger
Type=Vector
Color1=0xFFFF0000
Vector=213,222
Radius=66
Callback=Trigger
DebugMode=1
MouseMove=1|1|1|0
LButtonDown=0|1|1|0
LButtonUp=0|1|1|0
LButtonDBLClick=0|1|1|0
RButtonDown=0|1|1|0
RButtonUp=0|1|1|0
RButtonDBLClick=0|1|1|0
WheelChange=1|1|1|0
KeyDown=0|1|1|0
KeyUp=0|1|1|0
Note=
IsHidden=0
[Layer 5 Element 5 Data]
ElementType=TriggerWindow
Name=Trigger
Type=Window
WindowType=Layered
Color1=0xFF00FFFF
Rect=50,47,50,28|
Callback=Trigger
IsButton=1
DebugMode=1
MouseMove=1|1|1|0
LButtonDown=0|1|1|0
LButtonUp=0|1|1|0
LButtonDBLClick=0|1|1|0
RButtonDown=0|1|1|0
RButtonUp=0|1|1|0
RButtonDBLClick=0|1|1|0
WheelChange=1|1|1|0
KeyDown=0|1|1|0
KeyUp=0|1|1|0
Note=
IsHidden=0
*Edit* Fixed a possible problem with DPI scaling and the "Clip Events" button.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
@Hellbent
Thanks for your continual efforts for upgrading this tool, really appreciated.
Thanks for your continual efforts for upgrading this tool, really appreciated.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
V2.2.12
~Bug Fixes~
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.12
;v2.2.12 (Dec 7th 2024 - Dec 16th 2024)
;Fixed an issue with the triggerVector element where it wasn't scaling the radius.
;Fixed a DPI Scaling issue with the "DebugMode" Checkbox for the trigger element types.
;Fixed an issue where the control type for the TriggerControl element type wasn't setting the radios with the value.
;Fixed an issue with it not setting the checkbox for the "DebugMode" state.
;Cleaned up the spacing of some of the output code.
;Fixed the output code so that it uses the trigger callback instead of the trigger name.
;-This allows setting all triggers to go to one callback function.
;Added some logic to make it so that it only adds one copy of a callback if it is being shared.
~Bug Fixes~
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.12
;v2.2.12 (Dec 7th 2024 - Dec 16th 2024)
;Fixed an issue with the triggerVector element where it wasn't scaling the radius.
;Fixed a DPI Scaling issue with the "DebugMode" Checkbox for the trigger element types.
;Fixed an issue where the control type for the TriggerControl element type wasn't setting the radios with the value.
;Fixed an issue with it not setting the checkbox for the "DebugMode" state.
;Cleaned up the spacing of some of the output code.
;Fixed the output code so that it uses the trigger callback instead of the trigger name.
;-This allows setting all triggers to go to one callback function.
;Added some logic to make it so that it only adds one copy of a callback if it is being shared.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
There's a minor problem, when entering a non-digit character. I think it should verify the input first rather than apply the change immediately.
- Attachments
-
- checking1.png (96.4 KiB) Viewed 431 times
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Thank you.
I have added in the fix for a bunch of the element panel edits. It will take me awhile to work out all the minor bugs but if you point them out I'll try to get on them quick.
v2.2.13
https://raw.githubusercontent.com/HB-Scripts/HB-Bitmap-Maker-v2.2/refs/heads/main/HB%20Bitmap%20Maker%20v2.2.13
-Minor bug fixes and clean up.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Thanks for sharing this tool, @Hellbent. It's much appreciated. I'm encountering an error when trying to launch Bitmap Maker V2.2.13.
Code: Select all
Error: Expected an Integer but got a Float.
Specifically: 2.443359375
---- D:\Scripts\AHK_Programs\HB-Bitmap-Maker\GDIP_ALL V2.ahk
2379: ReturnRC := StrSplit(ReturnRC, "|")
2381: If (vPos[0] = "vCentre") || (vPos[0] = "vCenter")
▶ 2382: ypos += (Height-ReturnRC[4])//2
2383: Else
2383: If (vPos[0] = "Top") || (vPos[0] = "Up")
Call stack:
D:\Scripts\AHK_Programs\HB-Bitmap-Maker\GDIP_ALL V2.ahk (2382) : [Gdip_TextToGraphics] ypos += (Height-ReturnRC[4])//2
D:\Scripts\AHK_Programs\HB-Bitmap-Maker\HB Bitmap Maker.ahk (9559) : [ExportEventsClass.EventsClassClipButton1Function] Gdip_TextToGraphics( pGraphics , element.Text , options , element.FontType , ( element.Rect.W ) * scale , ( element.Rect.H ) * scale )
D:\Scripts\AHK_Programs\HB-Bitmap-Maker\HB Bitmap Maker.ahk (327) : [Main.AddMainWindowControls] This.AddControl( "Picture" , "x+m yp w" This.IconSize * 1.7 " h" This.IconSize " " , "hBitmap: " ExportEventsClass.EventsClassClipButton1Function( This.MainWindow.EventButtonElements , Scale := .1 ) , "EventClassButton" )
D:\Scripts\AHK_Programs\HB-Bitmap-Maker\HB Bitmap Maker.ahk (212) : [Main.Setup] This.AddMainWindowControls()
D:\Scripts\AHK_Programs\HB-Bitmap-Maker\HB Bitmap Maker.ahk (95) : [] Main.Setup()
> Auto-execute
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
There is a bug in the GDI+ lib that needs to be edited. If you look at the OP you will see a spoiler tag with an explanation on how to fix it.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
Thanks, @Hellbent. I didn’t click on that The script is very useful, truly impressive what you’ve created. Thanks again for sharing.
Re: [Tool] Bitmap Maker v2 (Screen Clipper and edit, Code generator )
There is a similar bug in the Layer Panel related to the width and height options for RECT. If you press Backspace multiple times to delete the value, an error occurs when the field becomes empty. "Error: Expected a number but got an empty string."