Du könntest folgendes probieren:
Text mit Clipput in die Zwischenablage kopieren und mit Send('^v') einfügen...
Falls du eine Maus hast und eine Bildschrimtastatur verwenden möchtest:
[autoit]Run(@SystemDir & "\osk.exe")
[/autoit]mfgE
Du könntest folgendes probieren:
Text mit Clipput in die Zwischenablage kopieren und mit Send('^v') einfügen...
Falls du eine Maus hast und eine Bildschrimtastatur verwenden möchtest:
[autoit]Run(@SystemDir & "\osk.exe")
[/autoit]mfgE
Hi
Schau dir mal die Hilfe zu DllStructCreate an.
Man muß beim Erstellen angeben, welche Datentypen sich darin befinden, und das steht in $sSize (sollte vielleicht $tagSize heißen ;))
Man muß natürlich auch Script 2 mitteilen, welche Datentypen dies sind und das macht man mit $sExtended
mfgE
Hi
du musst die Bits des Screenshoots in ein Struct kopieren, dieses dann mit Exchange Variables an das 2 Script senden und dort die Bits wieder zu einem Bild machen:
Script1.au3
#include "ExchangeVariables.au3"
#include <ScreenCapture.au3>
#include <WinAPI.au3>
HotKeySet("{ENTER}", "_SendScreenShot")
[/autoit] [autoit][/autoit] [autoit]Global $bDone = False
[/autoit] [autoit][/autoit] [autoit]_ExchangeVariables_Startup(1, 'ExchangeVariables Send Bitmap Example')
[/autoit] [autoit][/autoit] [autoit]While 1
Sleep(10)
WEnd
Func _SendScreenShot()
Local $hBmp = _ScreenCapture_Capture()
Local $hDC = _WinAPI_GetDC(0)
[/autoit] [autoit][/autoit] [autoit]Local $tBitmapInfo = DllStructCreate($tagBITMAPINFO)
DllStructSetData($tBitmapInfo, "Size", DllStructGetSize($tBitmapInfo))
_WinAPI_GetDIBits($hDC, $hBmp, 0, 0, 0, DllStructGetPtr($tBitmapInfo), 0)
[/autoit] [autoit][/autoit] [autoit]Local $iSize = DllStructGetData($tBitmapInfo, "SizeImage")
Local $iWidth = DllStructGetData($tBitmapInfo, "Width")
Local $iHeight = DllStructGetData($tBitmapInfo, "Height")
DllStructSetData($tBitmapInfo, "Compression", 0); Keine Ahnung, warum man das wieder reseten muß...
Local $sSize = "byte[" & $iSize & "]"
Local $tBits = DllStructCreate($sSize)
Local $iLines = _WinAPI_GetDIBits($hDC, $hBmp, 0, $iHeight, DllStructGetPtr($tBits), DllStructGetPtr($tBitmapInfo), 0)
_WinAPI_DeleteObject($hBmp)
_WinAPI_ReleaseDC(0, $hDC)
_ExchangeVariables_SetVariable(2, "tBitmapInfo", $tBitmapInfo, $tagBITMAPINFO)
_ExchangeVariables_SetVariable(2, "tBits", $tBits, $sSize)
_ExchangeVariables_SetVariable(2, "bSent", True)
[/autoit] [autoit][/autoit] [autoit]$tBits = 0
EndFunc ;==>_SendScreenShot
Script2.au3
#include "ExchangeVariables.au3"
#include <GDIPlus.au3>
#include <WinAPI.au3>
$pID = Run(@ScriptDir & "\Script1.exe")
HotKeySet("{ESC}", "_Exit")
Global $tBits, $tBitmapInfo, $bSent = False
_GDIPlus_Startup()
_ExchangeVariables_Startup(2, 'ExchangeVariables Send Bitmap Example', '_VarMsg')
Global $hBitmap
While 1
Sleep(100)
WEnd
_GDIPlus_Shutdown()
[/autoit] [autoit][/autoit] [autoit]Func _VarMsg($hWnd, $iMsg, $wParam, $lparam)
If $bSent = True Then
Local $iWidth = DllStructGetData($tBitmapInfo, "Width")
Local $iHeight = DllStructGetData($tBitmapInfo, "Height")
Local $hDC = _WinAPI_GetDC(0)
Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight)
_WinAPI_SetDIBits(0, $hBmp, 0, $iHeight, DllStructGetPtr($tBits), DllStructGetPtr($tBitmapInfo), 0)
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp)
_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Receive.bmp")
_WinAPI_DeleteObject($hBmp)
_WinAPI_ReleaseDC(0, $hDC)
[/autoit] [autoit][/autoit] [autoit]$tBits = 0
$tBitmapInfo = 0
$bSent = False
MsgBox(0, "Bild erhalten", "Script 2 hat ein Bild erhalten und unter: " & @ScriptDir & "\Receive.bmp gespeichert")
_Exit()
EndIf
EndFunc ;==>_VarMsg
Func _Exit()
ProcessClose($pID)
Exit
EndFunc ;==>_Exit
Script1.au3 zuerst als EXE compilieren
Script2.au3 ausführen (startet automatisch Script1.exe)
dann Enter drücken
mfgE
Wird das etwa ein Beitrag zum µIt? ![]()
du kannst eine eigene WinProc-Funktion registrieren, die vor der normalen GuiRegisterMsg-Funktion aufgerufen wird:
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <StructureConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
$hGui = GUICreate("Test", 400, 400)
$hListView = _GUICtrlListView_Create($hGui, "Listview", 10, 10, 380, 380)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)
GUISetState()
$hProc = DllCallbackRegister('_WinProc', 'ptr', 'hwnd;uint;wparam;lparam')
$hHook = _WinAPI_SetWindowLong($hGui, -4, DllCallbackGetPtr($hProc))
While GUIGetMsg() <> -3
Sleep(10)
WEnd
_WinAPI_SetWindowLong($hGui, -4, $hHook) ; original WinProc wiederherstellen
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _WinProc($hWnd, $iMsg, $iwParam, $ilParam)
If $iMsg <> $WM_NOTIFY Then Return _WinAPI_CallWindowProc($hHook, $hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
[/autoit] [autoit][/autoit] [autoit]$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $LVN_COLUMNCLICK ; A column was clicked
$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
_DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
_DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
EndSwitch
EndSwitch
Return _WinAPI_CallWindowProc($hHook, $hWnd, $iMsg, $iwParam, $ilParam); hier wird die normale WinProc aufgerufen, die man mit GuiRegisterMsg auswerten kann
EndFunc ;==>_WinProc
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint
nicht vergessen bei Exit die originale WinProc wieder herzustellen.
mfgE
Das Thema gefällt mir!
Mal sehn, wenn es die Zeit zulässt, dann bin ich auch dabei.
Suchst du sowas?:
#include <GDIPlus.au3>
#include <WinAPI.au3>
$iWidth = 640
$iHeight = 480
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile("Input.jpg")
$hGraphicsTemp = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphicsTemp)
$hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iWidth, $iHeight)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_ImageSaveToFile($hBitmap, "output.bmp")
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDispose($hGraphicsTemp)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
[/autoit]E
Wie schon gesagt geht die Transparenz beim Umwandeln zu GDI+ verloren
Zeichne die Icons am besten mit _WinAPI_DrawIconEx:
#include <WinAPI.au3>
[/autoit] [autoit][/autoit] [autoit]$hIcon = _WinAPI_PrivateExtractIcon(@SystemDir & "\calc.exe", 0, 256, 256)
[/autoit] [autoit][/autoit] [autoit]$hGui = GUICreate("Test", 256, 256)
GUISetBkColor(0x00AA00)
GUISetState()
$hDC = _WinAPI_GetDC($hGui)
[/autoit] [autoit][/autoit] [autoit]_WinAPI_DrawIconEx($hDC, 0, 0, $hIcon, 256, 256)
[/autoit] [autoit][/autoit] [autoit]While GUIGetMsg() <> -3
Sleep(20)
WEnd
_WinAPI_DestroyIcon($hIcon)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _WinAPI_PrivateExtractIcon($sIcon, $iIndex, $iWidth, $iHeight)
[/autoit] [autoit][/autoit] [autoit]Local $hIcon, $tIcon = DllStructCreate('hwnd'), $tID = DllStructCreate('hwnd')
Local $Ret = DllCall('user32.dll', 'int', 'PrivateExtractIcons', 'str', $sIcon, 'int', $iIndex, 'int', $iWidth, 'int', $iHeight, 'ptr', DllStructGetPtr($tIcon), 'ptr', DllStructGetPtr($tID), 'int', 1, 'int', 0)
If (@error) Or ($Ret[0] = 0) Then
Return SetError(1, 0, 0)
EndIf
$hIcon = DllStructGetData($tIcon, 1)
If ($hIcon = Ptr(0)) Or (Not IsPtr($hIcon)) Then
Return SetError(1, 0, 0)
EndIf
Return $hIcon
EndFunc ;==>_WinAPI_PrivateExtractIcon
Herzlichen Glückwunsch! ![]()
dein neuer Nick wird nun also: peetheB.Sc. ? ![]()
@Matthias: probier mal diesen Code:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinApi.au3>
#include <GDIPlus.au3>
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]$hGui = GUICreate("Test", 400, 400, Default, Default, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($hGui, 0x00EFCDAB, 0, 0x01, True)
GUISetState(@SW_SHOW)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics(400, 400, $hGraphics)
$hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFABCDEF)
$hPen = _GDIPlus_PenCreate(0xFFABCDEF, 5)
While 1
_GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)
$iW = Random(50, 200, 1)
$iH = Random(50, 200, 1)
$iX = Random(0, 400, 1)
$iY = Random(0, 400, 1)
_GDIPlus_GraphicsFillEllipse($hGfxBuffer, $iX - $iW / 2, $iY - $iH / 2, $iW, $iH, $hBrush)
$iW = Random(50, 200, 1)
$iH = Random(50, 200, 1)
$iX = Random(0, 400, 1)
$iY = Random(0, 400, 1)
_GDIPlus_GraphicsFillRect($hGfxBuffer, $iX - ($iW * 0.7) / 2, $iY - ($iH * 0.7) / 2, $iW * 0.7, $iH * 0.7, $hBrush)
_GDIPlus_GraphicsDrawRect($hGfxBuffer, $iX - $iW / 2, $iY - $iH / 2, $iW, $iH, $hPen)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
Sleep(1000)
WEnd
Func _Exit()
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_PenDispose($hPen)
_GDIPlus_GraphicsDispose($hGfxBuffer)
_GDIPlus_BitmapDispose($hBmpBuffer)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit
Sind die Ellipse und das Rechteck transparent?
erstmal Danke fürs Feedback!
Die blauen Balken zeigen das Frequenzspektrum von 20Hz - 20000Hz
Eine MP3 schneidet meistens alles über ca. 15000Hz ab - deshalb kein Ausschlag ganz rechts
Mit einer Wav-Datei (Samplingfrequenz 44100Hz => Abspielfrequenz 22050Hz) bewegen sich dann auch diese Balken...
Ach ja: Was Interessantes:
Damit man mit _WinAPI_SetLayeredWindowAttributes eine Farbe als Transparent einstellt und diese auch mit GDI+ angenommen wird muss man folgendes machen:
Farbe in GDI+ z.B.: 0xFFABCDEF
_WinAPI_SetLayeredWindowAttributes($hWnd, 0x00EFCDAB,0,0x01, True)
Es gab schon einige Threads, wo das jemand gebraucht hätte.
E
Edit: Da mich UEZ gestern mit diesem Script: GDI+ Zoomer
inspiriert hat, hab ich ein paar weiter Beispiele in "Vizualizing.zip" gepackt...
Eine Spielerei von mir
Ich weiß gar nicht, wie ich das Script beschreiben soll...
Eine Wellenform und Spektrum Anzeige eines Liedes auf dem Bildschirm ![]()
#AutoIt3Wrapper_UseX64=n
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include "Bass.au3"
#include "BassExt.au3"
#include <GDIPlus.au3>
#include "GDIP.au3"
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $iWidth = @DesktopWidth * 0.7
Global $iHeight = @DesktopHeight * 0.7
Global $iPerspL = Round($iWidth * 0.3)
Global $iPerspR = Round($iWidth * 0.1)
Global $iWaveH = $iHeight / 10
Global $aP_Flip[5][2] = [[4, 0],[0, $iHeight],[$iWidth, $iHeight],[0, 0],[$iWidth, 0]]
Local $aP_Warp[5][2] = [[4, 0],[$iPerspL, 0],[$iWidth - $iPerspR, 0],[0, $iHeight],[$iWidth, $iHeight]]
Global $sFile = FileOpenDialog("Open...", "", "playable formats (*.MP3;*.MP2;*.MP1;*.OGG;*.WAV;*.AIFF;*.AIF)")
[/autoit] [autoit][/autoit] [autoit]Global $hGui = GUICreate("FFT", $iWidth, $iHeight, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TRANSPARENT, $WS_EX_TOPMOST))
GUISetBkColor(0x000000)
_WinAPI_SetLayeredWindowAttributes($hGui, 0x00000000, 0xFF, 0x01, True)
GUISetState()
_GDIPlus_Startup()
Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer)
Global $hBrush_FFT = _GDIPlus_BrushCreateSolid(0xFF0000AA)
Global $hPen_FFT = _GDIPlus_PenCreate(0xFF0000FF)
Global $hBrush_WL = _GDIPlus_BrushCreateSolid(0x8800FF00)
Global $hPen_WL = _GDIPlus_PenCreate(0xEE00FF00)
Global $hBrush_WR = _GDIPlus_BrushCreateSolid(0x88FF0000)
Global $hPen_WR = _GDIPlus_PenCreate(0xEEFF0000)
Global $hBrush_Pos = _GDIPlus_BrushCreateSolid(0x44FFFFFF)
Global $hPen_Pos = _GDIPlus_PenCreate(0x88FFFFFF)
_BASS_Startup(@ScriptDir & "\bass.dll")
_BASS_EXT_Startup(@ScriptDir & "\bassExt.dll")
_BASS_Init(0, -1, 44100, 0, "")
[/autoit] [autoit][/autoit] [autoit]Global $hStream = _BASS_StreamCreateFile(False, $sFile, 0, 0, $BASS_SAMPLE_FLOAT)
[/autoit] [autoit][/autoit] [autoit]Global $aWave = _CreateWaveForm($sFile)
Global $aFFT = _BASS_EXT_CreateFFT(50, 0, 0, $iWidth, $iHeight / 2, $iWidth / 100, True)
_BASS_ChannelPlay($hStream, True)
GUIRegisterMsg(0x000F, "WM_PAINT")
GUIRegisterMsg(0x0014, "WM_ERASEBKGND")
Global $iTimer = TimerInit()
While _BASS_ChannelIsActive($hStream)
If TimerDiff($iTimer) > 25 Then
ConsoleWrite(TimerDiff($iTimer) & @CRLF)
$iTimer = TimerInit()
_GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000)
_BASS_EXT_ChannelGetFFT($hStream, $aFFT, 6)
If Not @error Then _DrawFFT($hGfxBuffer, $aFFT, $hBrush_FFT, $hPen_FFT)
_DrawWave($hGfxBuffer, $aWave[0], $aWave[2], 0, $hBrush_WL, $hPen_WL)
_DrawWave($hGfxBuffer, $aWave[1], $aWave[2], $iWaveH / 2, $hBrush_WR, $hPen_WR)
_DrawPos($hGfxBuffer, $iWaveH, $hBrush_Pos, $hPen_Pos)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
EndIf
WEnd
_Exit()
Func _CreateWaveForm($sFile)
Local $hStream = _BASS_StreamCreateFile(False, $sFile, 0, 0, $BASS_STREAM_DECODE)
Local $iBytes = _BASS_ChannelGetLength($hStream, $BASS_POS_BYTE)
Local $iLength = _BASS_ChannelBytes2Seconds($hStream, $iBytes)
Local $iRes = 88
Local $iWidth = $iLength * $iRes
Local $aWave = _BASS_EXT_ChannelGetWaveformDecode($hStream, $iWidth, $iWaveH, 0, $iLength, $iRes, "_WaveformGetProc")
ToolTip("")
_BASS_StreamFree($hStream)
Return $aWave
EndFunc ;==>_CreateWaveForm
Func _WaveformGetProc($handle, $percent)
ToolTip("Get Waveform: " & $percent & "%")
EndFunc ;==>_WaveformGetProc
Func _DrawPos($hGraphics, $iH, $hBrush, $hPen)
Local $hPath = _GDIPlus_PathCreate($FillModeAlternate)
_GDIPlus_PathAddRectangle($hPath, $iWidth / 2 - 2, 0, 4, $iHeight)
_GDIPlus_PathWarp($hPath, 0, $aP_Warp, 0, 0, $iWidth, $iHeight)
_GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush)
_GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen)
_GDIPlus_PathDispose($hPath)
EndFunc ;==>_DrawPos
Func _DrawWave($hGraphics, $pWave, $iCnt, $iYOffset, $hBrush, $hPen)
Local $hPath_O = _GDIPlus_PathCreate($FillModeAlternate)
Local $hPath_U = _GDIPlus_PathCreate($FillModeAlternate)
Local $hPath = _GDIPlus_PathCreate($FillModeAlternate)
Local $iPos = _BASS_ChannelGetPosition($hStream, $BASS_POS_BYTE)
Local $iSec = _BASS_ChannelBytes2Seconds($hStream, $iPos)
Local $iOffset = 88 * $iSec
Local $iXOffset = 0
Switch $iOffset
Case 0 To $iWidth / 2
$iXOffset = $iOffset
$iOffset = 0
Case Else
$iOffset -= $iWidth / 2
EndSwitch
Local $iSegments = $iCnt / $aWave[5] * $iWidth
If $iXOffset Then $iSegments -= $iWidth / 2 - $iXOffset
If $iOffset + $iSegments > $iCnt Then $iSegments = $iCnt - $iOffset
Local $fTension = 0.9
DllCall($ghGDIPDll, "uint", "GdipAddPathCurve3", "hwnd", $hPath_O, "ptr", $pWave, "int", $iCnt, "int", $iOffset, "int", $iSegments, "float", $fTension)
Local $aP_Flip[5][2] = [[4, 0],[0, $iWaveH / 4],[$iWidth, $iWaveH / 4],[0, 0],[$iWidth, 0]]
_GDIPlus_PathWarp($hPath_O, 0, $aP_Flip, 0, 0, $iWidth, $iWaveH / 4) ; flip
_GDIPlus_PathReverse($hPath_O)
DllCall($ghGDIPDll, "uint", "GdipAddPathCurve3", "hwnd", $hPath_U, "ptr", $pWave, "int", $iCnt, "int", $iOffset, "int", $iSegments, "float", $fTension)
Local $aP_Off[5][2] = [[4, 0],[0, 0],[$iWidth, 0],[0, $iWaveH / 4],[$iWidth, $iWaveH / 4]]
_GDIPlus_PathWarp($hPath_U, 0, $aP_Off, 0, -$iWaveH / 4, $iWidth, $iWaveH / 4) ; Y-Offset
_GDIPlus_PathAddPath($hPath, $hPath_U)
_GDIPlus_PathAddPath($hPath, $hPath_O)
_GDIPlus_PathCloseFigure($hPath)
Local $aP_YOff[5][2] = [[4, 0],[0, 0],[$iWidth, 0],[0, $iWaveH / 2],[$iWidth, $iWaveH / 2]]
_GDIPlus_PathWarp($hPath, 0, $aP_YOff, $iOffset, -$iYOffset, $iWidth, $iWaveH / 2) ; Y-Offset
If $iXOffset Then _GDIPlus_PathWarp($hPath, 0, $aP_YOff, -$iWidth / 2 + $iXOffset, 0, $iWidth, $iWaveH / 2) ; Y-Offset
_GDIPlus_PathWarp($hPath, 0, $aP_Warp, 0, 0, $iWidth, $iWaveH)
_GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush)
_GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen)
_GDIPlus_PathDispose($hPath_O)
_GDIPlus_PathDispose($hPath_U)
_GDIPlus_PathDispose($hPath)
EndFunc ;==>_DrawWave
Func _DrawFFT($hGraphics, $aFFT, $hBrush, $hPen)
Local $hPath = _GDIPlus_PathCreate($FillModeAlternate)
DllCall($ghGDIPDll, "uint", "GdipAddPathPolygon", "hwnd", $hPath, "ptr", $aFFT[0], "int", $aFFT[1])
_GDIPlus_PathWarp($hPath, 0, $aP_Flip, 0, 0, $iWidth, $iHeight) ; flip
DllCall($ghGDIPDll, "uint", "GdipAddPathPolygon", "hwnd", $hPath, "ptr", $aFFT[0], "int", $aFFT[1])
_GDIPlus_PathWarp($hPath, 0, $aP_Warp, 0, 0, $iWidth, $iHeight) ; warp
_GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush)
_GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen)
_GDIPlus_PathDispose($hPath)
EndFunc ;==>_DrawFFT
Func _Exit()
_BASS_StreamFree($hStream)
_BASS_Free()
_GDIPlus_BrushDispose($hBrush_FFT)
_GDIPlus_BrushDispose($hBrush_WL)
_GDIPlus_BrushDispose($hBrush_WR)
_GDIPlus_BrushDispose($hBrush_Pos)
_GDIPlus_PenDispose($hPen_FFT)
_GDIPlus_PenDispose($hPen_WL)
_GDIPlus_PenDispose($hPen_WR)
_GDIPlus_PenDispose($hPen_Pos)
_GDIPlus_GraphicsDispose($hGfxBuffer)
_GDIPlus_BitmapDispose($hBmpBuffer)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit
Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
Return 'GUI_RUNDEFMSG'
EndFunc ;==>WM_PAINT
Func WM_ERASEBKGND($hWnd, $uMsgm, $wParam, $lParam)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
Return True
EndFunc ;==>WM_ERASEBKGND
Der Hintergrund sollte transparent sein - hab das Script bisher nur auf WinXP getestet...
Alle benötigten Dateien sind im Anhang enthalten
Viel Spaß...
E
OMG wie geil!
mir fehlen die Worte ![]()
Die Errorabfrage direkt hinter FileRead:
[autoit]$sText = FileRead(@ScriptDir & '\notice.txt')
If @error Or Not $sText Then
MsgBox(0, "Error", "Konnte Datei nicht öffnen.")
Exit
EndIf
In der GDIp.au3 findest du die Funktion _GDIPlus_LineBrushCreate.
Damit kannst du einen Brush mit Farbverlauf erstellen;
und mit _GDIPlus_GraphicsFillPolygon zeichnest du dann das Dreieck.
Um das Dreieck in mehrere Farbverläufe zu unterteilen musst du einfach das Dreieck in mehrere Abschnitte teilen...
mfgE
Ich verwende immer diese zwei:
[autoit]GUIRegisterMsg($WM_PAINT, "WM_PAINT")
GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")
Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_PAINT
Func WM_ERASEBKGND($hWnd, $uMsgm, $wParam, $lParam)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0)
Return True
EndFunc ;==>WM_ERASEBKGND
wobei ich mir nicht mal sicher bin, welche der beiden wann zum Einsatz kommt ![]()
mfgE
Du kannst mit TimerInit und TimerDiff abeiten...
Ich glaub, das musst du mit 2 GUIs machen:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinApi.au3>
#include <GDIPlus.au3>
$hGui = GUICreate("Main", 195, 195, Default, Default, $WS_POPUP)
WinSetTrans($hGui, "", 100)
$hChild = GUICreate("Child", 200, 200, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGui)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateButton("Test", 10, 10)
_WinAPI_SetLayeredWindowAttributes($hChild, 0xFFFFFF)
GUISetState(@SW_SHOW, $hChild)
GUISetState(@SW_SHOW, $hGui)
_GDIPlus_Startup()
$Graphics = _GDIPlus_GraphicsCreateFromHWND($hChild)
$PenRect = _GDIPlus_PenCreate(0xFFFFAA00, 10)
_GDIPlus_GraphicsDrawRect($Graphics, 0, 0, 199, 199, $PenRect)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
mfgE
Alle Streams, welche nicht direkt abgespielt werden, müssen Decodingstreams sein; Nur der letzte in der Kette soll ein "normaler" abspielbarer Stream sein.
File -> Tempo -> Mixer
Also musst du auch bei Tempocreate $BASS_STREAM_DECODE angeben.
mfgE
Hi
Ich hab leider grad zuwenig Zeit um ein Beispiel zu erstellen...
Im Prinzip musst du nur 2 oder mehrere Streams zu einem Mixer-Stream zusammenfassen (BassMix.au3)
und auf diesen dann einen Encoder setzen:
$hEncoder = _BASS_Encode_Start($hMixer, @ScriptDir & "\Test.wav", $BASS_ENCODE_PCM) ; erzeugt eine wav-datei
$hEncoder = _BASS_Encode_Start($hMixer, 'lame -r -x -b128 -h - "' & @ScriptDir & '\Test.mp3"', 0) ; erzeugt eine mp3-datei
mfgE
Hier ist die 64bit Version von BassExt.dll:
mfgE