Here is an example. The function needs to have a few of the positions tweaked still, but the overall effect is clear.
Code: Select all
#Include <My Altered GDIP lib>
#Include <PopUpWindow Class>
#SingleInstance, Force
SetBatchlines, -1
GDIP_StartUp()
mag := 2 , r := 20
w := 200 * mag , h := 130 * mag
Gui1 := New PopUpWindow( { WindowName: "1" , WindowOptions: " -DPIScale +AlwaysOnTop " , WindowSmoothing: 2 , X: "Center" , Y: "Center" , W: w , H: h } )
Gui1.DrawBitmap( HB_BITMAP_MAKER( r ) , { X: 0 , Y: 0 , W: w , H: h } , dispose := 1 )
Gui1.UpdateWindow()
Gui1.ShowWindow()
return
GuiClose:
GuiContextMenu:
*ESC::ExitApp
Numpad3::PopUpWindow.Helper()
HB_BITMAP_MAKER( r := 25 ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 200 , 130 ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_BrushCreateSolid( "0xFF3399FF" ) , Gdip_FillRoundedRectangle( G , Brush , 8 , 10 , 180 , 50 , r ) , Gdip_DeleteBrush( Brush )
Gdip_SetSmoothingMode( G , 3 )
Brush := Gdip_BrushCreateSolid( "0xFF3399FF" ) , Altered_FillRoundedRectangle( G , Brush , 8 , 70 , 180 , 50 , r , 2 ) , Gdip_DeleteBrush( Brush )
Gdip_SetSmoothingMode( G , 2 )
Gdip_DeleteGraphics( G )
return pBitmap
}
;************************************************************************************************************************************************8
;************************************************************************************************************************************************8
Altered_FillRoundedRectangle(pGraphics, pBrush, x, y, w, h, r , S := 4 ){
;*********************************************************************************************
local pbitmap , G , bx , by
bx := x , by := y , x := -1 , y := -1
pBitmap := Gdip_CreateBitmap( w -1, h -1) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , S )
;*********************************************************************************************
Region := Gdip_GetClipRegion(G)
Gdip_SetClipRect(G, x-r, y-r, 2*r, 2*r, 4)
Gdip_SetClipRect(G, x+w-r, y-r, 2*r, 2*r, 4)
Gdip_SetClipRect(G, x-r, y+h-r, 2*r, 2*r, 4)
Gdip_SetClipRect(G, x+w-r, y+h-r, 2*r, 2*r, 4)
E := Gdip_FillRectangle(G, pBrush, x, y, w, h)
Gdip_SetClipRegion(G, Region, 0)
Gdip_SetClipRect(G, x-(2*r), y+r, w+(4*r), h-(2*r), 4)
Gdip_SetClipRect(G, x+r, y-(2*r), w-(2*r), h+(4*r), 4)
Gdip_FillEllipse(G, pBrush, x, y, 2*r, 2*r)
Gdip_FillEllipse(G, pBrush, x+w-(2*r), y, 2*r, 2*r)
Gdip_FillEllipse(G, pBrush, x, y+h-(2*r), 2*r, 2*r)
Gdip_FillEllipse(G, pBrush, x+w-(2*r), y+h-(2*r), 2*r, 2*r)
Gdip_SetClipRegion(G, Region, 0)
Gdip_DeleteRegion(Region)
;*********************************************************************
Gdip_DeleteGraphics( G )
Gdip_DrawImage(pGraphics, pBitmap, bx , by , w-1 , h-1)
Gdip_DisposeImage(pBitmap)
;*********************************************************************
return E
}