Jump to content

Splash Ekranın Traytip Gibi Efekli Açılması


Byogulcan
 Share

Recommended Posts

Bu kodlaru kullandıgım bi splash resmim var ama bunu sistem saatinin orda traytip baloncugu gibi göstermek istiyorum ve açılırken solarak gecis vs efekleri vermek istiyorum yardımcı olabilecek abilerimi arıyorum işte kodlar:

#NoTrayIcon
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

SoundPlay(".\fire.mp3",0)
;----- Variables -----

Global Const $AC_SRC_ALPHA = 1

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'PNG' -----
Myname()

GUISetState(@SW_SHOW)


Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize )
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha" , $iOpacity )
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC (0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC ($hMemDC)
EndFunc ;==>SetBitmap

Func Myname()
$yGUI = GUICreate("", 324, 91, (@DesktopWidth/2)-200, (@DesktopHeight/2)-60, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
_GDIPlus_Startup()
$yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\logo.png")
SetBitMap($yGUI , $yImage, 255)
GUISetState(@SW_SHOW)
EndFunc ;==>Myname

Sleep(2500)

Exit
Link to comment
Share on other sites

Aynen de Bu her ekran çözünürlüğünde aynı yerdemi olcak bide şeffaflıgı bozulmuş resimin ama genede kodlar için saol :)

Ya galiba anlaşamadık senle benim anlatmak istediğim yukarıdaki veridğim kodların bozulmaması sadece verdiğin gibi sistem saatitin üstünde traytip baloncugu gibi cıkması :)

Edited by Byogulcan
Link to comment
Share on other sites

Ekran çözünürlülüğü için kodlarda önlem almıştım!
Traytip balancuğuna resim ekleme konusuna daha önce ihtiyacım olmadı ve araştırmak için şuan zaman ayıramam.
Autoit forumlarına bakabilirsin!

Ilgili örnekte transparanı sen bilirleye biliyorsun!
Misal biraz daha transparent olmasını istiyorsan;
For $I = 10 To 225 Step 5 satırındaki 225 sayısını düşür!
Neys kolay gelsin...

Link to comment
Share on other sites

Abi ama sen beni gene anlamamıssın ben şimdi bu olaya kanaat getiriyorum benim yapmak istedğim traytip e resim koyma değil benim yapmak istediğim bu resimdeki gibi kurulum başladı lütfen bekleyin resimini her ekran çözünürlüğünde göstermek bu sadece benim bilgisayarımda 1280x1024 kullandıgım ekran çözünürlüğünde özelliğini gösteriyor.

işte açıklayan resim:http://c1109.hizliresim.com/11/9/24/13691.png

kullandıgım kodlar

[code]#NoTrayIcon
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

SoundPlay(".\Kurulum başladı.mp3",0)
;----- Variables -----

Global Const $AC_SRC_ALPHA = 1

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'PNG' -----
Myname()

GUISetState(@SW_SHOW)


Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize )
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha" , $iOpacity )
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC (0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC ($hMemDC)
EndFunc ;==>SetBitmap

Func Myname()
$yGUI = GUICreate("", 324, 91, (@DesktopWidth/2)+300, (@DesktopHeight/2)+400, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
_GDIPlus_Startup()
$yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\logo.png")
SetBitMap($yGUI , $yImage, 255)
GUISetState(@SW_SHOW)
EndFunc ;==>Myname

Sleep(5000)

Exit
[/code]

Link to comment
Share on other sites

@Byogulcan

Evet anlaşmazlık oldu. Neyse kodlarını düzelttim!
Sonucu yazarsın...

[codebox]#NoTrayIcon
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
SoundPlay(".\Kurulum başladı.mp3", 0)
;----- Variables -----
Global $ResW, $ResH
Myname()
Sleep(5000)
Exit


Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
$ResW = _GDIPlus_ImageGetWidth($hImage)
$ResH = _GDIPlus_ImageGetHeight($hImage)
DllStructSetData($tSize, "X", $ResW)
DllStructSetData($tSize, "Y", $ResH)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap

Func Myname()

Local $yGUI = GUICreate("", 1, 1, 0,0, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
_GDIPlus_Startup()
Local $yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\logo.png")
SetBitMap($yGUI, $yImage, 255)

Local $Gui_X = @DesktopWidth - ($ResW + 5)
Local $Gui_Y = @DesktopHeight - ($ResH + 5)

Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf
EndIf
WinMove($yGUI, "", $Gui_X, $Gui_Y, $ResW, $ResH)
GUISetState(@SW_SHOW)
EndFunc ;==>Myname[/codebox]

Link to comment
Share on other sites

  • 6 ay sonra...

[quote name='blue_life' date='24 September 2011 - 16:25 ' timestamp='1316870747' post='1084864']
Böyle bir şey mi istiyorsun?
[u][b]http://bluelife.zxq.net/Files/Autoit/Garbage/Splash.zip[/b][/u]
[/quote]

[b]blue_life hocam bunu png'e göre nasıl ayarlarız, denediğim zaman bozuluyor, teşekkürler[/b]

Link to comment
Share on other sites

@MAKINCI

Geçenlerde istediğin şey için forumda örnek verilmişti! Resim.png ve Müzik.mp3 dosyanı au3 script dosyanın yanına ekleyeceksin.
Biraz kurcala...

[codebox]#NoTrayIcon
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

Global $Resim = __TempFile(".png")
Global $MP3 = __TempFile(".mp3")
FileInstall("Resim.png", $Resim, 1) ;Resmi autoit içine alalım
FileInstall("Muzik.mp3", $MP3, 1) ;MP3ü autoit içine alalım

If FileExists($MP3) = 1 Then SoundPlay($MP3, 0)
Global $ResW, $ResH
_My_Gui()
Sleep(5000)

FileDelete($Resim)
FileDelete($MP3)
Exit


Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
$ResW = _GDIPlus_ImageGetWidth($hImage)
$ResH = _GDIPlus_ImageGetHeight($hImage)
DllStructSetData($tSize, "X", $ResW)
DllStructSetData($tSize, "Y", $ResH)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap

Func _My_Gui()
Local $yGUI = GUICreate("", 1, 1, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
_GDIPlus_Startup()
Local $yImage = _GDIPlus_ImageLoadFromFile($Resim)
SetBitMap($yGUI, $yImage, 255)

Local $Gui_X = @DesktopWidth - ($ResW + 5)
Local $Gui_Y = @DesktopHeight - ($ResH + 5)

Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf
EndIf
WinMove($yGUI, "", $Gui_X, $Gui_Y, $ResW, $ResH)
GUISetState(@SW_SHOW)
EndFunc ;==>_My_Gui

Func __TempFile($s_FileExtension = ".tmp", $s_DirectoryName = @TempDir, $s_FilePrefix = "~", $i_RandomLength = 7)
; Check parameters
If IsKeyword($s_FilePrefix) Then $s_FilePrefix = "~"
If IsKeyword($s_FileExtension) Then $s_FileExtension = ".tmp"
If IsKeyword($i_RandomLength) Then $i_RandomLength = 7
If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @TempDir ; First reset to default temp dir
If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @ScriptDir ; Still wrong then set to Scriptdir
; add trailing \ for directory name
If StringRight($s_DirectoryName, 1) <> "\" Then $s_DirectoryName = $s_DirectoryName & "\"
;
Local $s_TempName
Do
$s_TempName = ""
While StringLen($s_TempName) < $i_RandomLength
$s_TempName = $s_TempName & Chr(Random(97, 122, 1))
WEnd
$s_TempName = $s_DirectoryName & $s_FilePrefix & $s_TempName & $s_FileExtension
Until Not FileExists($s_TempName)

Return $s_TempName
EndFunc ;==>__TempFile[/codebox]

Link to comment
Share on other sites

[b]@blue_life
Hocam bu konuda sorun yok herşey tamam, anlatmak istediğim şuydu oğulcana yaptığınız örnekte [color="#8B0000"]http://bluelife.zxq.net/Files/Autoit/Garbage/Splash.zip[/color] resim bmp ve solarak gelip gidiyor bu diğerlerinden farklı, png'e göre ayarladığımda kodlar bozuluyor, hocam bozulmaması için ne yapmalıyız, resim bmp yerine png olucak, teşekkürler... [/b]

Kodlar

[php]Local $File = @ScriptDir & "\Test.bmp"

Local $ResW = 329
Local $ResH = 79
Local $Gui_X = @DesktopWidth - ($ResW + 5)
$Gui_Y = @DesktopHeight - ($ResH + 5)
Local $Bclor = 0x0000FF

Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf

EndIf

Local $hGUI = GUICreate("BlueLife Test", $ResW, $ResH, $Gui_X, $Gui_Y, 0x80000000, 0x00000080 + 0x00000008 + 0x00080000)
GUISetBkColor($Bclor)
GUICtrlCreatePic($File,0,0,$ResW,$ResH)

__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,5)
GUISetState(@SW_SHOW,$hGUI)
For $I = 10 To 225 Step 5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(25)
Next


Sleep(5000) ;5 Saniye bekleme

For $I = 225 To 5 Step -5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(10)
Next

Func __WinAPI_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $dwFlags = 0x03, $isColorRef = False)
If $dwFlags = Default Or $dwFlags = "" Or $dwFlags < 0 Then $dwFlags = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $aResult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hWnd, "dword", $i_transcolor, "byte", $Transparency, "dword", $dwFlags)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>_WinAPI_SetLayeredWindowAttributes[/php]

Edited by MAKINCI
Link to comment
Share on other sites

blue_life sensei senin kodları değiştirmeye çalışıyorum fakat beceremedim. Bu koda mp3 (ses dosyasını) nereye eklemeliyim kodu ne olmalı, ben pek beceremem kod işlerini bi yönlendirsen mutlu olurum. Bu koda sadece mp3 dosyası ekleyeceğim. (kod nedir acaba ve nereye eklemeliyim, teşekkür ederim.)




#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Local $File = @ScriptDir & "\Test.bmp"

Local $ResW = 329
Local $ResH = 79
Local $Gui_X = @DesktopWidth - ($ResW + 5)
$Gui_Y = @DesktopHeight - ($ResH + 5)
Local $Bclor = 0x0000FF

Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf

EndIf

Local $hGUI = GUICreate("BlueLife Test", $ResW, $ResH, $Gui_X, $Gui_Y, 0x80000000, 0x00000080 + 0x00000008 + 0x00080000)
GUISetBkColor($Bclor)
GUICtrlCreatePic($File, 0, 0, $ResW, $ResH)

__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor, 5)
GUISetState(@SW_SHOW, $hGUI)
For $I = 10 To 225 Step 5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor, $I)
Sleep(25)
Next


Sleep(5000) ;5 Saniye bekleme

For $I = 225 To 5 Step -5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor, $I)
Sleep(10)
Next

Func __WinAPI_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $dwFlags = 0x03, $isColorRef = False)
If $dwFlags = Default Or $dwFlags = "" Or $dwFlags < 0 Then $dwFlags = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $aResult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hWnd, "dword", $i_transcolor, "byte", $Transparency, "dword", $dwFlags)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>__WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

[b]@beyantt hemşerim[/b]




[php]Local $File = @ScriptDir & "\Test.bmp"

Local $ResW = 329
Local $ResH = 79
Local $Gui_X = @DesktopWidth - ($ResW + 5)
$Gui_Y = @DesktopHeight - ($ResH + 5)
Local $Bclor = 0x0000FF
Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf

EndIf

Local $hGUI = GUICreate("BlueLife Test", $ResW, $ResH, $Gui_X, $Gui_Y, 0x80000000, 0x00000080 + 0x00000008 + 0x00080000)
GUISetBkColor($Bclor)
GUICtrlCreatePic($File,0,0,$ResW,$ResH)
FileInstall("Filan.mp3", @TempDir & "\Filan.mp3")
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,5)
GUISetState(@SW_SHOW,$hGUI)
SoundPlay(@TempDir & "\Filan.mp3", 10)
For $I = 10 To 225 Step 5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(25)
Next
Sleep(5000) ;5 Saniye bekleme

For $I = 225 To 5 Step -5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(10)
Next

Func __WinAPI_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $dwFlags = 0x03, $isColorRef = False)
If $dwFlags = Default Or $dwFlags = "" Or $dwFlags < 0 Then $dwFlags = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $aResult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hWnd, "dword", $i_transcolor, "byte", $Transparency, "dword", $dwFlags)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>_WinAPI_SetLayeredWindowAttributes
FileDelete(@TempDir & "\Filan.mp3")
[/php]

Link to comment
Share on other sites

MAKINCI, png yi diğer resim formatlarıyla karıştırma, autoitte png kullanmak çok baş belası birşey olabiliyor ama senin istediğin basit bir şey:

[code]#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>

;~ Splash
Global Const $AC_SRC_ALPHA = 1

_GDIPlus_Startup()

$pngSrc = "splash.png"

$hImage = _GDIPlus_ImageLoadFromFile($pngSrc)
$width = _GDIPlus_ImageGetWidth($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)

$Splash = GUICreate("", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED, $DS_MODALFRAME)

GUISetState(@SW_LOCK)

SetBitmap($Splash, $hImage, 0)

GUISetState()

WinSetOnTop($Splash, "", 1)

For $i = 0 To 255 Step 1
SetBitmap($Splash, $hImage, $i)
;Sleep(10)
Next

Sleep(1000)

For $i = 255 To 0 Step -1
SetBitmap($Splash, $hImage, $i)
Next

GUIDelete($Splash)

_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap[/code]

Link to comment
Share on other sites

@MAKINCI
buradada belirtildiği gibi sanırım desteklemez png ama udflerle çalışırsan belki gerekli açıklamalar yapılmış galiba aynı özelliği ytaşıyor :)
bende direk png kullanmak isterdim ama olmuyor mecburen gimp programından şeffaf bmp yapıyorum kendime bu gibi çalışmalarda

[code]http://www.tnctr.com/topic/199267-[/code]

Link to comment
Share on other sites

[quote name='beyantt' date='25 April 2012 - 00:07 ' timestamp='1335301641' post='1191877']
Üstadlar peki şimdi cahil biri olarak soruyorum hazırladıgım çalışmayı nasıl exe olarak kaydedeceğim. Tek tıklama ile çalışmasını sağlayacagım.
[/quote]

[b]Tabi senin bu kodlara ilk önce file install vermen lazım exe yapınca koyduğun resmi exenin yanından sil çalışmaz [/b]

[b]en üstüde bununla değiştir[/b] Local $File = @TempDir & "\Test.bmp"

Edited by MAKINCI
Link to comment
Share on other sites

[quote name='MAKINCI' date='24 April 2012 - 21:11 ' timestamp='1335301919' post='1191881']
[b]Tabi senin bu kodlara ilk önce file install vermen lazım exe yapınca koyduğun resmi exenin yanından sil çalışmaz [/b]

[b]en üstüde bununla değiştir[/b] Local $File = @TempDir & "\Test.bmp"
[/quote]

Değişiklikleri aynen yaptım fakat, mp3 çalıyor, reklam baner ı gelmiyor. Kodu aşağı ekledim.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Local $File = @TempDir & "\Test.bmp"
Local $ResW = 329
Local $ResH = 79
Local $Gui_X = @DesktopWidth - ($ResW + 5)
$Gui_Y = @DesktopHeight - ($ResH + 5)
Local $Bclor = 0x0000FF
Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf

EndIf

Local $hGUI = GUICreate("BlueLife Test", $ResW, $ResH, $Gui_X, $Gui_Y, 0x80000000, 0x00000080 + 0x00000008 + 0x00080000)
GUISetBkColor($Bclor)
GUICtrlCreatePic($File,0,0,$ResW,$ResH)
FileInstall("Filan.mp3", @TempDir & "\Filan.mp3")
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,5)
GUISetState(@SW_SHOW,$hGUI)
SoundPlay(@TempDir & "\Filan.mp3", 10)
For $I = 10 To 225 Step 5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(25)
Next
Sleep(5000) ;5 Saniye bekleme

For $I = 225 To 5 Step -5
__WinAPI_SetLayeredWindowAttributes($hGUI, $Bclor,$I)
Sleep(10)
Next

Func __WinAPI_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $dwFlags = 0x03, $isColorRef = False)
If $dwFlags = Default Or $dwFlags = "" Or $dwFlags < 0 Then $dwFlags = 0x03
If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $aResult = DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hWnd, "dword", $i_transcolor, "byte", $Transparency, "dword", $dwFlags)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>_WinAPI_SetLayeredWindowAttributes
FileDelete(@TempDir & "\Filan.mp3")

Link to comment
Share on other sites

[b]@beyantt
resmide exenin içine alman lazım dediğim gibi exenin yanından silersen çalışmaz, exenin içine almak için [color="#8B0000"]FileInstall("\Test.bmp",@TempDir & "\Test.bmp")[/color] verdiğim kodun altına bunu yaz sonrada en alta bunu [color="#8B0000"]FileDelete(@TempDir & "\Test.bmp")[/color][/b]

Edited by MAKINCI
Link to comment
Share on other sites

@MAKINCI

Aşağıdaki gibi bir şey mi istiyorsun?

[codebox]#NoTrayIcon
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>

Opt("GUICloseOnESC", 0) ;Esc tuşuyla kapanmasını engellemek için

Global $Resim = __TempFile(".png")
Global $MP3 = __TempFile(".mp3")
FileInstall("Resim.png", $Resim, 1) ;Resmi autoit içine alalım
FileInstall("Muzik.mp3", $MP3, 1) ;MP3ü autoit içine alalım

If FileExists($MP3) = 1 Then SoundPlay($MP3, 0)
Global $ResW, $ResH
_My_Gui(5000)

FileDelete($Resim)
FileDelete($MP3)
Exit


Func SetBitmap($hGUI, $hImage, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
$ResW = _GDIPlus_ImageGetWidth($hImage)
$ResH = _GDIPlus_ImageGetHeight($hImage)
DllStructSetData($tSize, "X", $ResW)
DllStructSetData($tSize, "Y", $ResH)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap

Func _My_Gui($Slep = 5000)
Local $yGUI = GUICreate("", 1, 1, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
_GDIPlus_Startup()
Local $yImage = _GDIPlus_ImageLoadFromFile($Resim)
SetBitMap($yGUI, $yImage, 5)

Local $Gui_X = @DesktopWidth - ($ResW + 5)
Local $Gui_Y = @DesktopHeight - ($ResH + 5)

Local $Shell_Pos = WinGetHandle("[CLASS:Shell_TrayWnd]") ;CLASS:Progman
If $Shell_Pos <> "" Then
$Shell_Pos = WinGetPos($Shell_Pos)

If UBound($Shell_Pos) = 4 Then
If $Shell_Pos[1] < 1 Then
If $Shell_Pos[0] > 0 Then $Gui_X = @DesktopWidth - ($Shell_Pos[2] + ($ResW + 5))
Else
If $Shell_Pos[0] < 1 Then $Gui_Y = @DesktopHeight - ($Shell_Pos[3] + ($ResH + 5))
EndIf
EndIf
EndIf
WinMove($yGUI, "", $Gui_X, $Gui_Y, $ResW, $ResH)
GUISetState(@SW_SHOW)

For $I = 10 To 225 Step 5
SetBitMap($yGUI, $yImage, $I)
Sleep(25)
Next
Sleep($Slep) ;Sleep
For $I = 225 To 5 Step -5
SetBitMap($yGUI, $yImage, $I)
Sleep(10)
Next
EndFunc ;==>_My_Gui

Func __TempFile($s_FileExtension = ".tmp", $s_DirectoryName = @TempDir, $s_FilePrefix = "~", $i_RandomLength = 7)
; Check parameters
If IsKeyword($s_FilePrefix) Then $s_FilePrefix = "~"
If IsKeyword($s_FileExtension) Then $s_FileExtension = ".tmp"
If IsKeyword($i_RandomLength) Then $i_RandomLength = 7
If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @TempDir ; First reset to default temp dir
If Not FileExists($s_DirectoryName) Then $s_DirectoryName = @ScriptDir ; Still wrong then set to Scriptdir
; add trailing \ for directory name
If StringRight($s_DirectoryName, 1) <> "\" Then $s_DirectoryName = $s_DirectoryName & "\"
;
Local $s_TempName
Do
$s_TempName = ""
While StringLen($s_TempName) < $i_RandomLength
$s_TempName = $s_TempName & Chr(Random(97, 122, 1))
WEnd
$s_TempName = $s_DirectoryName & $s_FilePrefix & $s_TempName & $s_FileExtension
Until Not FileExists($s_TempName)

Return $s_TempName
EndFunc ;==>__TempFile[/codebox]

Link to comment
Share on other sites

  • 3 hafta sonra ...

[quote][color="#445563"][font="verdana, tahoma, sans-serif"]@Byogulcan[/font][/color]>[color="#445563"][font="verdana, tahoma, sans-serif"]Evet anlaşmazlık oldu. Neyse kodlarını düzelttim![/font][/color]">[color="#445563"][font="verdana, tahoma, sans-serif"]Sonucu yazarsın...[/font][/color][/quote]

Burada resimde mask yok yani resmin kenarlarındaki mavilik gözüküyor

[quote][color="#445563"][font="verdana, tahoma, sans-serif"]Böyle bir şey mi istiyorsun?[/font][/color]
[color="#445563"][font="verdana, tahoma, sans-serif"][u][b]http://bluelife.zxq.net/Files/Autoit/Garbage/Splash.zip[/b][/u][/font][/color][color="#445563"][font="verdana, tahoma, sans-serif"] [/font][/color][/quote]


Bunda mask var fark nedir hocam

Edited by korasoglu
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...