Jump to content

Gui Üzerine Item Oluşturmak


Dj Demir
 Share

Recommended Posts

Merhaba arkadaşlar.
Uzun zamandır AutoIT ile çalışma yapmadım.
Dolayısıyla gerileme oldu.
Şu an bir çalışma yapmaktayım ama
Şöyle bir sorunum var.
Arka plan resminin üzerine checkbox oluşturuyorum, checkbox resmin arkasında kalıyor.
Bunu nasıl halledebilirim acaba?

Link to comment
Share on other sites

resim altına 
GUICtrlSetState($resim , $GUI_DISABLE)

eklemen yeterli olacaktır 

örnek amaçlı dersen
$resim  = GUICtrlCreatePic("mkmm.jpg",200,200,200,200)
GUICtrlSetState($resim , $GUI_DISABLE)

şeklinde yapacaksın :)

Edited by mesale0077
Link to comment
Share on other sites

Hmm haklısın bir de GUI_DISABLE vardı ya :)
Teşekkürler. Yalnız hatırlayamadığım bir şey daha var.
Checkbox'u resmin üzerine aldığım zaman çirkin bir görüntü oluşuyor 
Var mıydı onu da düzeltmenin yolu ?

Link to comment
Share on other sites

$GUI_WS_EX_TRANSPARENT ya da $WS_EX_TRANSPARENT ile Transparan yaptım ama nafile.

Link to comment
Share on other sites

ibocan Teşekkürler.

Evet UxTheme.dll çağırdığım zaman oluyor.

Ancak ben GUI teması olarak ayrı bir dll dosyası kullanıyorum.

O dll dosyası ile beraber yaptığım zaman chechbox yine transparan olmuyor.

Edited by Dj Demir
Link to comment
Share on other sites

#Simpson_Bart 
Güzel çalışma olmuş ancak demek istediğim şu.
Bu komutları Sıradan bir GUI üzerine konulan chechkbox'a uyguladığımız zaman sonuç alabiliyoruz.
Ancak ben GUI'yi oluştururken dll dosyası kullanıp GUI'ye tema ekliyorum.
Böyle olunca bu komutlar maalesef işe yaramıyor.

 

Örnek

 

 

#NoTrayIcon

#RequireAdmin
 
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <String.au3>
 
 
Global $TemaShe = @ScriptDir & "\BLacK.she"
Global $TemaDLL = @ScriptDir & "\BLacK.dll"
 
 
_BLacK_White_App()
 
Func _BLacK_White_App()
 
$BLacK = GUICreate(" ® BLacK White Application Pack 2013", 1200, 670, -1, 5)
 GUICtrlCreatePic("files\arka2.jpg", -1, -1, 1230, 700)
 
 GUICtrlCreateCheckbox("sdfdgfdhdfhdfhdfhdfhdf",50,50,200,15)
GUICtrlSetFont(-1,8.5,800,"","Tahoma",2)
 
_Tema ( $TemaShe)
GUISetState ( )
 
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
 
 
EndFunc
 
 
Func _Tema ( $TemayiUyguLa )
$Dll = DllOpen ($TemaDLL)
DllCall ( $Dll, "int", "SkinH_AttachEx", "str", $TemayiUyguLa, "str", "mhgd" )
DllCall ( $Dll, "int", "SkinH_SetAero", "int", 1 )
EndFunc
 
Edited by Dj Demir
Link to comment
Share on other sites

#Simpson_Bart 
Güzel çalışma olmuş ancak demek istediğim şu.
Bu komutları Sıradan bir GUI üzerine konulan chechkbox'a uyguladığımız zaman sonuç alabiliyoruz.
Ancak ben GUI'yi oluştururken dll dosyası kullanıp GUI'ye tema ekliyorum.
Böyle olunca bu komutlar maalesef işe yaramıyor.

 

Örnek

 

#NoTrayIcon

#RequireAdmin
 
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <String.au3>
 
 
Global $TemaShe = @ScriptDir & "\BLacK.she"
Global $TemaDLL = @ScriptDir & "\BLacK.dll"
 
 
_BLacK_White_App()
 
Func _BLacK_White_App()
 
$BLacK = GUICreate(" ® BLacK White Application Pack 2013", 1200, 670, -1, 5)
 GUICtrlCreatePic("files\arka2.jpg", -1, -1, 1230, 700)
 
 GUICtrlCreateCheckbox("sdfdgfdhdfhdfhdfhdfhdf",50,50,200,15)
GUICtrlSetFont(-1,8.5,800,"","Tahoma",2)
 
_Tema ( $TemaShe)
GUISetState ( )
 
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
 
 
EndFunc
 
 
Func _Tema ( $TemayiUyguLa )
$Dll = DllOpen ($TemaDLL)
DllCall ( $Dll, "int", "SkinH_AttachEx", "str", $TemayiUyguLa, "str", "mhgd" )
DllCall ( $Dll, "int", "SkinH_SetAero", "int", 1 )
EndFunc
 

 

 

 

 

dostum sonradan kod vermeniz  beni öldürüyor

bu arada size verdiğim örnek size faydalı olmadımı

birde dll cakışması bazen olabiliyor

diyer dosyalarıda verseydinizde deneme şansımız olsaydı :)

Link to comment
Share on other sites

Örnek fayda sağlamadı.
Çünkü dediğim gibi sıradan guilerde işe yarıyor.
Buyur kullandığım dll ve she dosyası.
Aynı anda çalıştıramadım ben.

 

http://www.mediafire.com/?b3fy46l481d1yzb

Link to comment
Share on other sites

udfye dönüştürmek lazım ama basit bir yöntem kullandım
umarım işine yarar
deneyince size uygun olup olmadığını  belirtirseniz memnun olurum
muhtemelen çalışacaktır :)
bu aralar  benim pc de problem var güç kaynağında sıkıntı var
kapanma yapıyor ,yada miladi doldu galiba :)
bunuda arkadaşın pcsinde hazırladım :hadiya:
[spoiler]# @mesale0077 tarafından yapıldı.
#NoTrayIcon
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
Local $nAngle = 270
Local $nPI = 4 * ATan(1)

Opt("GUIOnEventMode", 1)
Global $TemaShe = @ScriptDir & "\BLacK.she"
Global $TemaDLL = @ScriptDir & "\BLacK.dll"
$Dll = DllOpen ($TemaDLL)
DllCall ( $Dll, "int", "SkinH_AttachEx", "str",$TemaShe, "str", "mhgd" )
DllCall ( $Dll, "int", "SkinH_SetAero", "int", 1 )
$GUI = GUICreate("GDI mesale0077", 400, 400)
GUISetOnEvent(-3, "_Quit")
$Pic1 = GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 400, 0)
GUICtrlSetState( $Pic1 , $GUI_disable)
_GDIPlus_Startup()
$GDI = _GDIPlus_GraphicsCreateFromHWND($GUI)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixRotate($hMatrix, $nAngle, False)
_GDIPlus_GraphicsSetTransform($GDI, $hMatrix)

$check= GUICtrlCreateCheckbox("",50,50,15,15 )
GUISetState ( )
While 1
Vstring("mesale0077", 70,70, 12, $nAngle)
Sleep(250)
WEnd

Func VString($txt, $nx, $ny, $size, $nAngle)
$nXt = $nx * Cos($nAngle * $nPI / 180) + $ny * Sin($nAngle * $nPI / 180)
$nYt = -$nx * Sin($nAngle * $nPI / 180) + $ny * Cos($nAngle * $nPI / 180)
_GDIPlus_GraphicsDrawString($GDI, $txt, $nXt, $nYt, "Arial", $size, 0x0002)
EndFunc

Func _Quit()
_GDIPlus_GraphicsDispose($GDI)
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_Shutdown()
Exit
EndFunc

[/spoiler]

Edited by mesale0077
Link to comment
Share on other sites

#mesale0077
yalnız yazının rengini kendimce bir kaç yöntem denememe rağmen değiştiremedim.

Link to comment
Share on other sites

buyrun işte kodlar

bu nasıl olmuş

[spoiler]
#NoTrayIcon
#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
Global $TemaShe = @ScriptDir & "\BLacK.she"
Global $TemaDLL = @ScriptDir & "\BLacK.dll"
$Dll = DllOpen ($TemaDLL)
DllCall ( $Dll, "int", "SkinH_AttachEx", "str",$TemaShe, "str", "mhgd" )
DllCall ( $Dll, "int", "SkinH_SetAero", "int", 1 )
$GUI = GUICreate("GDI @mesale0077", 400, 400)
$Pic1 = GUICtrlCreatePic(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & "Examples\GUI\msoobe.jpg", 0, 0, 400, 400, 0)
GUICtrlSetState( $Pic1 , $GUI_disable)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI )
$check= GUICtrlCreateCheckbox("",50,50,15,15 )
GUISetState ( )
While 1
_GDIPlus_GraphicsDrawStringColor($hGraphics, "@mesale0077", 68, 48, "Arial", 12, 0, 0xFFFF1400)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_Shutdown()
Exit
EndSwitch
WEnd


Func _GDIPlus_GraphicsDrawStringColor($hGraphics, $sString, $nX, $nY, $sFont = "Arial", $nSize = 10, $iFormat = 0, $iBrush = 0xFF000000)
Local $hBrush, $iError, $hFamily, $hFont, $hFormat, $aInfo, $tLayout, $bResult
$hBrush = _GDIPlus_BrushCreateSolid($iBrush)
$hFormat = _GDIPlus_StringFormatCreate($iFormat)
$hFamily = _GDIPlus_FontFamilyCreate($sFont)
$hFont = _GDIPlus_FontCreate($hFamily, $nSize)
$tLayout = _GDIPlus_RectFCreate($nX, $nY, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
$bResult = _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
$iError = @error
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hBrush)
Return SetError($iError, 0, $bResult)
EndFunc
[/spoiler]

Edited by mesale0077
Link to comment
Share on other sites

Tam olmuş teşekkürler.
Ben de Brush kullanmayı denedim ama _GDIPlus'tan tam anlamıyorum beceremedim.
 

Link to comment
Share on other sites

Pek iyi diyemiyorum kendime :)
Ufak tefek yapıyoruz , uğraşıyoruz işte.
Yardımların için tekrar teşekkürlerimi sunmak istiyorum.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...