Jump to content

GUICtrlCreatePic() Distortion in metro style SideBar Bug (or it isnt?) PLEASE HELP


 Share

Recommended Posts

I am facing this problem while trying to make a metro UI Sidebar, tried to fix it all night but couldnt, problem is that whenever I use a colored background (whether a stretched disabled pic in BG or using GUISetBkColor) the pic placed in the gui using GUICtrlCreatePic() shows some distortion on the runtime, I have attached all the image files, au3, and a screen shot. Please help me out fixing this distortion problem, Thanks in advance.

Sincerely,

A helpless Person (Needs help asap)

Distortion Help.rar

Link to comment
Share on other sites

I cannot see any problem / distortion when neither running the code nor in Screen Shot.jpg.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Ok, if the pixel is disturbing you then try this:

#include <Constants.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global $SideBarWidth = 86
Global $SideBarHeight = @DesktopHeight
Global $SideBarXpos = @DesktopWidth - 86
Global $SideBarYpos = 0
Global $SideBar = GUICreate("", $SideBarWidth, $SideBarHeight, $SideBarXpos, 0, $WS_POPUP, BitOR(0x8, 0x80)) ; $WS_POPUP,,$WS_EX_TOPMOST, $WS_EX_TOOLWINDOW ,$ WS_EX_APPWINDOW
;GUISetBkColor(0x1D1D1D)
$ButtonNum = 3
$FSB_YPos = ((@DesktopHeight - ($ButtonNum * 100)) / 2)
$SB_BG = GUICtrlCreatePic("bg.jpg", 0, 0, $SideBarWidth, $SideBarHeight)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $SB_ScreenB = GUICtrlCreatePic("", 1, $FSB_YPos, 85, 100)
Global $SB_RegionB = GUICtrlCreatePic("", 1, $FSB_YPos + 100, 85, 100)
Global $SB_WindowB = GUICtrlCreatePic("", 1, $FSB_YPos + 200, 85, 100)
_GDIPlus_Startup()
Global $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\SB_FSB.jpg")
Global $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_GDIPlus_ImageDispose($hImage)
_hBmpToPicControl($SB_ScreenB, $hHBitmap)
_hBmpToPicControl($SB_RegionB, $hHBitmap)
_hBmpToPicControl($SB_WindowB, $hHBitmap, True)
GUISetState(@SW_SHOW, $SideBar)

While GUIGetMsg() <> -3
WEnd
GUIDelete()
_GDIPlus_Shutdown()
Exit

Func _hBmpToPicControl($iCID, ByRef $hBmp, $iFlag = 0)
    Local $hOldBmp = GUICtrlSendMsg($iCID, 0x0172, 0, $hBmp)
    If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp)
    If $iFlag Then _WinAPI_DeleteObject($hBmp)
EndFunc   ;==>_hBmpToPicControl

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...