My sample code , you could just run it and see that when the second line is drawn the first vanishes
Code: Select all
#Include, Gdip.ahk
#SingleInstance, Force
SetBatchlines, -1
GDIP_StartUp()
Gui, 1:+AlwaysOnTop
Gui, 1:Add, Picture, xm ym w400 h400 0xE hwndPicHwnd
Gui, 1:Show,, Demo
progSizexx := 20
progSizeyy := 20
progSizex := 28
progSizey := 15
loop, 25
{
DiagonalProgressBar( PicHwnd, progSizexx, progSizeyy, progSizex, progSizey )
progSizex+=10
progSizey+=10
sleep, 15
}
progSizexx := 300
progSizeyy := 20
progSizex := 28
progSizey := 15
loop, 25
{
DiagonalProgressBar( PicHwnd, progSizexx, progSizeyy, progSizex, progSizey )
progSizex-=10
progSizey+=10
sleep, 15
}
return
DiagonalProgressBar( hwnd , sizexx := "", sizeyy := "", sizex := "", sizey := "" ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 400 , 400) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Pen := Gdip_CreatePen( "0xFF880000" , 5 ) , Gdip_DrawLine( G , Pen , sizexx , sizeyy , sizex , sizey ) Gdip_DeletePen( Pen )
Gdip_DeleteGraphics( G )
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage(pBitmap)
SetImage( hwnd , hBitmap )
DeleteObject( hBitmap )
}
GuiClose:
esc:
ExitApp
Code: Select all
#Include, Gdip.ahk
#SingleInstance, Force
SetBatchlines, -1
GDIP_StartUp()
Gui, 1:+AlwaysOnTop
Gui, 1:Add, Picture, xm ym w400 h400 0xE +BackgroundTrans hwndPicHwnd
Gui, 1:Add, Picture, xm ym w400 h400 0xE +BackgroundTrans hwndPicHwnd2
Gui, 1:Show,, Demo
progSizexx := 20
progSizeyy := 20
progSizex := 28
progSizey := 15
loop, 25
{
DiagonalProgressBar( PicHwnd, progSizexx, progSizeyy, progSizex, progSizey )
progSizex+=10
progSizey+=10
sleep, 15
}
progSizexx := 300
progSizeyy := 20
progSizex := 28
progSizey := 15
loop, 25
{
DiagonalProgressBar( PicHwnd2, progSizexx, progSizeyy, progSizex, progSizey )
progSizex-=10
progSizey+=10
sleep, 15
}
return
DiagonalProgressBar( hwnd , sizexx := "", sizeyy := "", sizex := "", sizey := "" ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 400 , 400) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Pen := Gdip_CreatePen( "0xFF880000" , 5 ) , Gdip_DrawLine( G , Pen , sizexx , sizeyy , sizex , sizey ) Gdip_DeletePen( Pen )
Gdip_DeleteGraphics( G )
hBitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
Gdip_DisposeImage(pBitmap)
SetImage( hwnd , hBitmap )
DeleteObject( hBitmap )
}
GuiClose:
esc:
ExitApp