Sorry, aber ich verstehe nicht, was du genau willst.
Kannst du ein Beispiel geben, z.B. eine Zeile, die in einem 2D Array abgebildet wird.
Gruß,
UEZ
Sorry, aber ich verstehe nicht, was du genau willst.
Kannst du ein Beispiel geben, z.B. eine Zeile, die in einem 2D Array abgebildet wird.
Gruß,
UEZ
Sollte mit der WinAPIEx.au3 funzen:
[autoit]
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
[/autoit][autoit][/autoit][autoit]Global $Text, $Path = @MyDocumentsDir & '\'
[/autoit][autoit][/autoit][autoit]While 1
$Path = FileOpenDialog('Select File', _WinAPI_PathRemoveFileSpec($Path), 'All Files (*.*)', 1 + 2)
If $Path Then
If _WinAPI_GetBinaryType($Path) Then
Switch @extended
Case $SCS_32BIT_BINARY
$Text = ' is 32-bit Windows-based application.'
Case $SCS_64BIT_BINARY
$Text = ' is 64-bit Windows-based application.'
Case $SCS_DOS_BINARY
$Text = ' is MS-DOS–based application.'
Case $SCS_OS216_BINARY
$Text = ' is 16-bit OS/2-based application.'
Case $SCS_PIF_BINARY
$Text = ' is PIF file that executes an MS-DOS–based application.'
Case $SCS_POSIX_BINARY
$Text = ' is POSIX–based application.'
Case $SCS_WOW_BINARY
$Text = ' is 16-bit Windows-based application.'
Case Else
$Text = ' is unknown executable type.'
EndSwitch
Else
$Text = ' is not executable file.'
EndIf
MsgBox(64, '_WinAPI_GetBinaryType()', '"' & _WinAPI_PathStripPath($Path) & '"' & $Text)
Else
ExitLoop
EndIf
WEnd
Gruß,
UEZ
Jetzt fehlt nur noch der Sound...
Gruß,
UEZ ![]()
Wenn du ein Bläschen triffst, dann teilt sich dieser doch und das Teilen mit einer kleinen Animation hinterlegen, würde besser Aussehen, als wenn sie sich "nur" einfach teilen.
Das Ganze noch mit Sound hinterlegen, würde es noch "würzen".
Gruß,
UEZ
Ist schön geworden!
Wenn die Bläschen platzen würden, würde es schöner aussehen.
Ach ja, erinnert mich an Pang!
Gruß,
UEZ
Du musst die Größe des Control mitanpassen:
[autoit]
...
WinSetState("Foto", "", @SW_MINIMIZE) ;wenn aktiv wird in der nächsten Zeile die Größe 600 bzw. 100 ignoriert
GUICtrlSetPos($idPreviewPic, 10, 10, 600, 100)
_PreviewLoadImage($datei1, $idPreviewPic, 600, 100)
WinSetState("Foto", "", @SW_RESTORE)
...
Gruß,
UEZ
Erinnert mich ein bisschen an Asteroids....
Wenn ich mit der Maus genau über dem Raumschiff bin, flippt der komplett aus. Ansonsten gut gemacht!
Gruß,
UEZ
War mir schon klar, dass es Eukalyptus richtig heiß gemacht hat, dafür was zu coden. ![]()
Well done! ![]()
Gruß,
UEZ
Probiere es mal damit:
[autoit]
$delta_time = 10 * 1000 ;10 Sekunden
$hDLL = DllOpen("user32.dll")
$timer = TimerInit()
Do
$key = _KeyPressCheck(1, 221, -1, $hDLL)
If $key Then $timer = TimerInit()
Sleep(50)
Until TimerDiff($timer) > $delta_time And Not $key
DllClose($hDll)
ConsoleWrite($delta_time / 1000 & " Sekunden ohne Eingabe" & @LF)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]$timer = TimerInit()
Do
MsgBox(0, "Info: " & Int(TimerDiff($timer) / 1000), "Test")
Until TimerDiff($timer) > $delta_time
; #FUNCTION# ===================================================================
; Name : _KeyPressCheck
; Description: Check if specified keys are pressed
; Parameter(s): sHexKey - Key to check for
; Requirement(s): None
; Return Value(s): On Success - Returns 1
; On Failure - Returns 0
; Author(s): Valuater
;===============================================================================
Func _KeyPressCheck($iStart, $iFinish, $iHexKey = -1, $vDLL = 'user32.dll')
Local $ikey, $ia_R
For $ikey = $iStart To $iFinish
If $iHexKey = -1 Then $ia_R = DllCall($vDLL, 'int', 'GetAsyncKeyState', 'int', '0x' & Hex($ikey, 2))
If $iHexKey <> -1 Then $ia_R = DllCall($vDLL, 'int', 'GetAsyncKeyState', 'int', '0x' & $iHexKey)
If Not @error And BitAND($ia_R[0], 0x8000) = 0x8000 Then Return 1
Next
Return 0
EndFunc ;==>__KeyPressCheck
Gruß,
UEZ
Wie immer sehr cooooooooollllllllllllll!
Ich muss mal auch wieder was mit GDI+ machen! Bin total aus der Übung...
Gruß,
UEZ
Nimm' mal eine dunkle Transparentfarbe:
[autoit]
Func _GuiCreateLabel ($iHwnd, $iText, $iX, $iY, $iW, $iH)
$iGui = GUICreate ("",$iW, $iH, $iX, $iY,BitOR($WS_POPUP, $WS_VISIBLE), BitOR ($WS_EX_MDICHILD,$WS_EX_LAYERED), $iHwnd)
GUICtrlCreateLabel ($iText,2,0,$iW,$iH,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetColor (-1,0xff0000)
GUICtrlSetFont (-1,10,400,0,"Arial", 4) ;teste auch mal 5 anstatt 4
GUISetBkColor(0x010000, $iGui)
_WinAPI_SetLayeredWindowAttributes($iGui, 0x010000, 255)
EndFunc
Gruß,
UEZ
Lasse $WS_BORDER in Zeile 56 einfach weg.
Gruß,
UEZ
Du kannst mal
[autoit]
GUICtrlSetFont (-1,10,400,0,"Arial", 4)
probieren.
Gruß,
UEZ
Lasse doch die Transparenz vom Label weg und setze die Hintergrundfarbe vom Label schwarz.
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
_GDIPlus_Startup()
Global Const $hImage_BG = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\background.png")
Global Const $iW = _GDIPlus_ImageGetWidth($hImage_BG)
Global Const $iH = _GDIPlus_ImageGetHeight($hImage_BG)
Global Const $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
SetTransparentBitmap($hGUI, $hImage_BG)
Global Const $iFW = 90
Global Const $iFH = 50
Global Const $hGUI_Child = GUICreate("", $iFW, $iFH, 100, 100, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
Global Const $idLabel = GUICtrlCreateLabel("Test", 0, 0, $iFW, $iFH)
GUICtrlSetBkColor(-1, 0)
GUICtrlSetColor(-1, 0xF0F0F0)
GUICtrlSetFont(-1, 32, 400, 0, "Arial", 4)
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hGUI_Child)
_GDIPlus_ImageDispose($hImage_BG)
[/autoit] [autoit][/autoit] [autoit]Global Const $SC_DRAGMOVE = 0xF012
GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")
Do
Until GUIGetMsg() = -3
_GDIPlus_Shutdown()
Exit
Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
_SendMessage($hWnd, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc ;==>_WM_LBUTTONDOWN
Func SetTransparentBitmap($hGUI, $hImage, $iOpacity = 0xFF)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
_WinAPI_ReleaseDC(0, $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", 1)
_WinAPI_UpdateLayeredWindow($hGUI, 0, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetTransparentBitmap
Gruß,
UEZ
Andy: Feine Sache! Genau sowas hatte ich mir vorgestellt, aber mit ASM bin ich seit der Primzahlen Geschichte nicht mehr vertraut, obwohl so viel Potential darin steckt!
Gruß,
UEZ
Es ist weder GDI+ noch QuickDraw das Problem, sondern AutoIt!
256*256=256^2= 65536 Schleifendurchgänge sind für AutoIt als Intepretersprache leider zu langsam. ASM würde dir hier sehr wahrscheinlich weiterhelfen!
Gruß,
UEZ
Herzlichen Glückwunsch Mr. GDI+ und alles Gute!
Ich hoffe weitere ultra coole GDI+ Demos zu sehen! ![]()
Gruß,
UEZ
In AutoIt Windows Screenshooter v1.43 Build 2012-02-16 Final habe ich das implementiert. Du kannst das Vorschaubild mit der Maus bewegen und mit dem Mausrad rein- bzw. rauszoomen.
Gruß,
UEZ
Vielleicht so was?
[autoit]
#include <Array.au3>
$days = "So;So,Mo;Mo,Di;Di,Mi;Mi,Do;Do,Fr;Fr,Sa;Sa"
$aDays = StringSplit(StringRegExpReplace($days, "(\w+);(\w+)", "$1"), ",", 2)
_ArrayDisplay($aDays)
Gruß,
UEZ
Bis ich den Code fertig bekommen habe, hast du es bereits selbst hinbekommen!
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Opt("GuiOnEventMode", 1)
OnAutoItExitRegister("_end")
[/autoit] [autoit][/autoit] [autoit]$chipsetpfad = FileOpenDialog("Chipset", @ScriptDir & "\", "Bilder (*.png)", 1)
_GDIPlus_Startup()
$chipset = _GDIPlus_ImageLoadFromFile($chipsetpfad)
$iW = _GDIPlus_ImageGetWidth($chipset)
$iH = _GDIPlus_ImageGetHeight($chipset)
$newchipset = GUICreate("Neues Chipset", $iW, $iH)
GUISetState(@SW_SHOW)
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($newchipset)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
$hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsDrawImage($hGraphics, $chipset, 0, 0)
_GDIPlus_GraphicsDrawImage($hContext, $chipset, 0, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetOnEvent($GUI_EVENT_PRIMARYUP, "getPixelcolor")
While 1
Sleep(100)
WEnd
Func getPixelcolor()
$pos = MouseGetPos()
$pix = PixelGetColor($pos[0], $pos[1])
$sMsgText = StringFormat("Der hexadezimale Wert der Farbe ist: %#06x\t", $pix)
MsgBox(0, "PixelGetColor", $sMsgText)
Local $x, $y, $aResult, $iColor
For $y = 0 To $iH -1
For $x = 0 To $iW - 1
$aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "hwnd", $hBitmap, "int", $x, "int", $y, "uint*", 0)
$iColor = $aResult[4]
If (("0x" & Hex($iColor, 6)) / $pix) = 1 Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "hwnd", $hBitmap, "int", $x, "int", $y, "uint", "0x00" & Hex($pix, 6))
Next
Next
_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Test.png")
_end()
EndFunc ;==>getPixelcolor
Func CLOSEClicked()
_end()
EndFunc ;==>CLOSEClicked
Func _end()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_ImageDispose($chipset)
_GDIPlus_Shutdown()
ShellExecute(@ScriptDir & "\Test.png")
Exit
EndFunc ;==>_end
Die Ideen waren die Gleichen!
Gruß,
UEZ