1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. myicq

Beiträge von myicq

  • Pixelganau zeichnen mit GDI+ / AutoIT - (wie) geht das ?

    • myicq
    • 17. Juni 2015 um 16:21

    @autobert2 : geht fast.. dank Beispiel im Englishen Forum. Aber es scheint als der Textumdrehung der ganze Canvas dreht. Deshalb kann ich meine Striche nicht zeichnen.

    Ich sollte vielleicht mein Text separat zeichnen, und dann als Overlay einsetzen. Aber ich bin unsicher wie das geht.

    Also: Text 0 Grad geht perfekt. Kann aber nur Beispiele für 90-Grad text im Gui finden.

    Mein Code soweit:

    Spoiler anzeigen
    AutoIt
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    #include<Color.au3>
    
    
    _GDIPlus_Startup()
    
    
    #region GDI+
    
    
    ;create an empty bitmap
    Global Const $iWidth = 2000, $iHeight = 900     ;dimension of the bitmap
    Global Const $iStride = 0, $pScan0 = 0, $iPixelFormat =  $GDIP_PXF01INDEXED ;some bitmap parameters
    $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iPixelFormat, $iStride, $pScan0)
    
    
    
    
    ; This is used where documentation mentions
    ; "handle to a graphics object"
    Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    
    
    Global Const $iBgColor = 0xFFFFFFFF ;define background color -> ARGB
    
    
    ;~ $hGraphics Handle to a Graphics object
    _GDIPlus_GraphicsClear($hContext, $iBgColor) ;clear empty bitmap with new color
    
    
    
    
    ; define the pen
    ; default = 0xFF000000 = black solid.
    $hPen = _GDIPlus_PenCreate(0xFF000000, 2,1)	; 2 px black
    
    
    ;
    ; DRAW the lines and text
    	for $x = 10 to $iWidth Step 90
    			ConsoleWrite("Drawing text line for --> " & $x & @lf)
    			GDIPlus_SetAngledText($hContext, $x & "  pixel", $x+15,150, 45, "Arial", 25)
    	Next
    
    
    	for $x = 10 to $iWidth Step 90
    			ConsoleWrite("Drawing graphics line for --> " & $x & @LF)
    			_GDIPlus_GraphicsDrawLine($hContext, $x, 10, $x, $iHeight-10, $hPen)
    		Next
    
    
    
    
    ;save result as JPG and PNG (conversation is done automatically)
    _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\New_Image.bmp")
    
    
    _GDIPlus_BitmapDispose($hBitmap) ;release bitmap
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_Shutdown()
    #endregion
    
    
    
    
    ; #FUNCTION# ================================================================
    ; Name...........: GDIPlus_SetAngledText
    ; Description ...: Adds text to a graphic object at any angle.
    ; Syntax.........: GDIPlus_SetAngledText($hGraphic, $nText, [$iCentreX, [$iCentreY, [$iAngle , [$nFontName , _
    ;										[$nFontSize, [$iARGB, [$iAnchor]]]]]]] )
    ; Parameters ....: $hGraphic   - The Graphics object to receive the added text.
    ;				   $nText      - Text string to be displayed
    ;                  $iCentreX       - Horizontal coordinate of horixontal centre of the text rectangle        (default =  0 )
    ;                  $iCentreY        - Vertical coordinate of vertical centre of the text rectangle             (default = 0 )
    ;                  $iAngle     - The angle which the text will be place in degrees.         (default = "" or blank = 0 )
    ;                  $nFontName  - The name of the font to be used                      (default = "" or Blank = "Arial" )
    ;                  $nFontSize  - The font size to be used                                  (default = "" or Blank = 12 )
    ;                  $iARGB      - Alpha(Transparency), Red, Green and Blue color (0xAARRGGBB) (Default= "" = random color
    ;           																		   or Default = Blank = 0xFFFF00FF )
    ;				   $iAnchor    - If zero (default) positioning $iCentreX, $iCentreY values refer to centre of text string.
    ;				   				 If not zero positioning $iCentreX, $iCentreY values refer to top left corner of text string.
    ; Return values .: 1
    ; Author ........: Malkey
    ; Modified.......:
    ; Remarks .......: Call _GDIPlus_Startup() before starting this function, and call _GDIPlus_Shutdown()after function ends.
    ;                  Can enter calculation for Angle Eg. For incline, -ATan($iVDist / $iHDist) * 180 / $iPI , where
    ;				   $iVDist is Vertical Distance,  $iHDist is Horizontal Distance, and, $iPI is Pi, (an added Global Const).
    ;				   When used with other graphics, call this function last. The MatrixRotate() may affect following graphics.
    ; Related .......: _GDIPlus_Startup(), _GDIPlus_Shutdown(), _GDIPlus_GraphicsDispose($hGraphic)
    ; Link ..........;
    ; Example .......; Yes
    ; ========================================================================================
    Func GDIPlus_SetAngledText($hGraphic, $nText, $iCentreX = 0, $iCentreY = 0, $iAngle = 0, $nFontName = "Arial", _
    		$nFontSize = 12, $iARGB = 0xFF000000, $iAnchor = 0)
    	local Const $iPI = 3.1415926535897932384626433832795
    	Local $x, $y, $iX, $iY, $iWidth, $iHeight
    	Local $hMatrix, $iXt, $iYt, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
    
    
    	; Default values
    	If $iAngle = "" Then $iAngle = 0
    	If $nFontName = "" Or $nFontName = -1 Then $nFontName = "Arial" ; "Microsoft Sans Serif"
    	If $nFontSize = "" Then $nFontSize = 12
    	If $iARGB = "" Then ; Randomize ARGB color
    		$iARGB = "0xFF" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2)
    	EndIf
    
    
    	$hFormat = _GDIPlus_StringFormatCreate(0)
    	$hFamily = _GDIPlus_FontFamilyCreate($nFontName)
    	$hFont = _GDIPlus_FontCreate($hFamily, $nFontSize, 1, 3)
    	$tLayout = _GDIPlus_RectFCreate($iCentreX, $iCentreY, 0, 0)
    	$aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $nText, $hFont, $tLayout, $hFormat)
    	$iWidth = Ceiling(DllStructGetData($aInfo[0], "Width"))
    	$iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    
    
    	;Later calculations based on centre of Text rectangle.
    	If $iAnchor = 0 Then ; Reference to middle of Text rectangle
    		$iX = $iCentreX
    		$iY = $iCentreY
    	Else ; Referenced centre point moved to top left corner of text string.
    		$iX = $iCentreX + (($iWidth - Abs($iHeight * Sin($iAngle * $iPI / 180))) / 2)
    		$iY = $iCentreY + (($iHeight + Abs($iWidth * Sin($iAngle * $iPI / 180))) / 2)
    	EndIf
    
    
    	;Rotation Matrix
    	$hMatrix = _GDIPlus_MatrixCreate()
    	_GDIPlus_MatrixRotate($hMatrix, $iAngle, 1)
    	_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    
    
    	;x, y are display coordinates of center of width and height of the rectanglular text box.
    	;Top left corner coordinates rotate in a circular path with radius = (width of text box)/2.
    	;Parametric equations for a circle, and adjustments for centre of text box
    	$x = ($iWidth / 2) * Cos($iAngle * $iPI / 180) - ($iHeight / 2) * Sin($iAngle * $iPI / 180)
    	$y = ($iWidth / 2) * Sin($iAngle * $iPI / 180) + ($iHeight / 2) * Cos($iAngle * $iPI / 180)
    
    
    	;Rotation of Coordinate Axes formulae - To display at x and y after rotation, we need to enter the
    	;x an y position values of where they rotated from. This is done by rotating the coordinate axes.
    	;Use $iXt, $iYt in  _GDIPlus_RectFCreate. These x, y values is the position of the rectangular
    	;text box point before rotation. (before translation of the matrix)
    	$iXt = ($iX - $x) * Cos($iAngle * $iPI / 180) + ($iY - $y) * Sin($iAngle * $iPI / 180)
    	$iYt = -($iX - $x) * Sin($iAngle * $iPI / 180) + ($iY - $y) * Cos($iAngle * $iPI / 180)
    
    
    	$hBrush = _GDIPlus_BrushCreateSolid($iARGB)
    	$tLayout = _GDIPlus_RectFCreate($iXt, $iYt, $iWidth, $iHeight)
    	_GDIPlus_GraphicsDrawStringEx($hGraphic, $nText, $hFont, $tLayout, $hFormat, $hBrush)
    
    
    	; Clean up resources
    	_GDIPlus_MatrixDispose($hMatrix)
    	_GDIPlus_FontDispose($hFont)
    	_GDIPlus_FontFamilyDispose($hFamily)
    	_GDIPlus_StringFormatDispose($hFormat)
    	_GDIPlus_BrushDispose($hBrush)
    	$tLayout = ""
    	Return 1
    EndFunc   ;==>GDIPlus_SetAngledText
    
    
    Func Color_SetHSL($iHue, $Saturation = 180, $Brightness = 160)
    	local $aInput =""
    	If IsArray($iHue) Then
    		$aInput = $iHue
    	Else
    		Local $aInput[3] = [$iHue, $Saturation, $Brightness]
    	EndIf
    	Local $aiRGB = _ColorConvertHSLtoRGB($aInput)
    	Return "0x" & Hex(Round($aiRGB[0]), 2) & Hex(Round($aiRGB[1]), 2) & Hex(Round($aiRGB[2]), 2)
    EndFunc   ;==>_Color_SetHSL
    Alles anzeigen

    Dateien

    New_Image.bmp 226,86 kB – 361 Downloads
  • Pixelganau zeichnen mit GDI+ / AutoIT - (wie) geht das ?

    • myicq
    • 16. Juni 2015 um 14:03

    Ich möchte für eine Projekt pixel-genau zeichnen können. Schwarz auf Weiss.

    Beispiel im Anhang.

    Ich habe erfolgreich das Bild im Anhang mit Perl / Imagemagick gemacht. Problem ist: ich kann Perl nicht für die Kollegen kompilieren. Deshalb die Frage: kann ich das mit AutoIT irdgendwie machen ?

    Ich muss im Bild haben

    • Linien horizontal oder Vertikal, in pixel-breite
    • Text horizontal oder Vertikal, in definierte größe, pixel-genau position

    Ich brauche nicht die komplette Lösung, nur 1 oder 2 kleine Beispiele wie ich mit AutoIT linien ziechne.

    Danke im Voraus!

    (Bild ist Testbild einer Industriedrucker)

    Dateien

    metric_grid_h1200_30x2.jpg 70,67 kB – 0 Downloads
  • Alternativ zu Figlet, basiert auf LED Laufschrift ?

    • myicq
    • 2. März 2014 um 09:51

    Ich habe mit interesse das LED Laufschrift probiert. NICE!

    Habe jetzt die Frage - währe es nicht möglich das gleiche Prinzip zu nutzen, um eine Figlet-ähnliche ASCII-bild zu erstellen - OHNE Figlet Fonts, und MIT support für Unicode-chars ?

    Dann kann ich in Font "Banner" (ähnlich) auch zB "Düsenflieger" oder "Dåseøls-æder" schrieben.

    (eigentlich versuche ich durchzuschauen wie man von Font bis bit-array komme).

    Eine Idee ? Oder absolut crazy ?

  • Haupt Autoit-Site immer noch nicht funktioniert

    • myicq
    • 26. Februar 2014 um 11:09

    M23. Thanks for the update !
    Meanwhile we all work hard developing an AutoIT program that can calculate percentual uptime for the host.

    Cross all fingers that you are back online soon. Know you are working hard for us all.
    :thumbup:

  • LED - Laufschrift

    • myicq
    • 25. Februar 2014 um 09:34

    Haben andere auch das Problemschen das nach minimize + normalize den Hintergrund nicht mehr Schwarz ist, sondern Kriese auf Weissen hintergrund ?
    (Win7,32bit)

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 7. Februar 2014 um 09:08

    Andy.. du hast recht, eine UDF hat im grunde immer Interesse.

    Die Lösung von Eukalyptus ist im Grunde nicht weit vom Ziel, allerdings liegen die Bits falsch rum.. 01000000 statt 00000010. Wie kann ich diese Bitrotation im griff hätte..

    Aber ich bin voller neugier von diene ASM-Lösung. Wie kann ich dir danken ?

    - myicq

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 6. Februar 2014 um 23:10
    Zitat von UEZ

    Was ist eigentlich der Zweck, Bitmaps in dieses Format umzuwandeln?

    Gruß,
    UEZ

    Ja, sollte ich vielleicht auch erklären :)

    Zweck ist die Bitmaps auf eine industrieller Controller zu nutzen. Es ist möglich die Bitmaps mittels einer Designprogramm umzuwandeln, aber diese Programm ist recht schwierig zu nutzen. Ich möchte gern 1) eine 1-Click Lösung bauen, und 2) für Automatisierung eine UDF (für meine nutzen, hat wohl nicht generell Interesse). Arh, und ich werde dazu auch viel über BMPs, byte/bit-umwandlung etc erfahren. Dank an Euch.

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 6. Februar 2014 um 14:33

    UEZ.. ich schrieb "32 x n".. aber korrekt, es hätte deutlicher sein können.

    DANKE trotzdem für die Hilfe, jetzt bin ich über 2 Tage viel schlauer geworden, über BMPs etc.

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 6. Februar 2014 um 10:16

    Update: versuch mit _FreeImage_GetPixelIndex($ImageHandle, $iX, $iY, $i) :
    Funktion von UEZ (GDI+): etwa 18 Sek
    FreeImage _FreeImage_GetPixelIndex() : über 80 Sekunden (!)

    ScanLines() mit FreeImage währe evtl eine Lösung.

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 6. Februar 2014 um 08:17

    UEZ,

    Fast korrekt. Ich habe dein Beispiel ein Bisschen geändert - die Reihenfolge der Pixel war umgekehrt. Jetzt geht es, und Erbebnis scheint korrekt zu sein.

    Leider dauert eine Bild von 1152 * 3680 etwa 18 Sekunden. Das gleiche in PHP oder Delphi ugf. 3-4 Sekunden.

    Meine gedanken ab hier um das ganze schneller zu machen:

    • DLL wie zB FreeImage zu nutzen (wird das Schneller sein ?)
    • Lesen mit LockBits und $GDIP_PXF01INDEXED - die Struktur ist wohl jetzt 32 Bit ? Aber das kriege ich mit DllStrukt nicht hin

    Wenn es überhaupt nicht möglich ist, muss ich mit 18 Sek leben.

    Mein Code so weit:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>
    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt('ExpandVarStrings', 1) ; can put vars in strings...for debugging

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\template.bmp")

    [/autoit] [autoit][/autoit] [autoit]

    If _
    (mod(_GDIPlus_ImageGetWidth($hBitmap), 8)>0) Or _
    (mod(_GDIPlus_ImageGetHeight($hBitmap), 8)>0) Then Exit MsgBox(0, "Fehler", "Bild ist nicht Interger von 8 groß!") * _GDIPlus_Shutdown()
    $iTimer = TimerInit()
    $aResult = BitmapToBinary($hBitmap)
    ConsoleWrite(TimerDiff($iTimer) & @LF)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

    [/autoit] [autoit][/autoit] [autoit]

    ; ===========================================================
    ; write output
    ;
    FileDelete(@ScriptDir & "\out.log")
    $of = FileOpen(@ScriptDir & "\out.log", 2 + 16)
    For $i = 0 To UBound($aResult) - 1
    FileWrite($of, Chr($aResult[$i]))
    Next
    FileClose($of)

    [/autoit] [autoit][/autoit] [autoit]

    ; ==================================================================
    ; BipmapToBinary
    ;
    ; macht aus PixelData eine Array
    ; Pixel werden per Column gelesen
    ; pixel 8,7,...1 ; 16,15,...9 etc
    ;
    Func BitmapToBinary($hImage)
    Local $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) ;get width and height of the image
    ConsoleWrite("BMP size: Width = $iW$ and Height = $iH$ " & @LF)

    [/autoit] [autoit][/autoit] [autoit]

    Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB) ;locks a portion of a bitmap for reading and writing. More infor at http://msdn.microsoft.com/en-us/library/…8(v=vs.85).aspx
    Local $iScan0 = DllStructGetData($tBitmapData, "Scan0") ;get scan0 (pixel data) from locked bitmap

    [/autoit] [autoit][/autoit] [autoit]

    Local $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0)
    Local $iPixel, $iRowOffset, $iX, $iY, $iVal, $iBits, $y = 0, $z = 0
    $rowsize_bytes = Floor((1 * $iW + 31) / 32) * 4
    $pixel_size = $rowsize_bytes * $iH
    ConsoleWrite("Pixelsize = $pixel_size$" & @LF)
    local $aBytes[$pixel_size]

    [/autoit] [autoit][/autoit] [autoit]

    $repeats = $iH / 8 ; read each column by block of 1 byte = 8 pixel/bit

    [/autoit] [autoit][/autoit] [autoit]

    For $iX = 0 To $iW - 1 ; first take each COLUMN...
    For $byteblock = 0 To $repeats-1
    ; byteblock = 0
    ; 8 7 6 ... 1 ==>> 8 * 0 + 8 ... 8 * 0 +1
    ; byteblock = 1
    ; 16 15 .. 9
    ; etc

    [/autoit] [autoit][/autoit] [autoit]

    $bb_start = (8*$byteblock )+7 ; ==> pixel data 0-based
    $bb_end = (8*$byteblock)

    [/autoit] [autoit][/autoit] [autoit]

    for $iY = $bb_start to $bb_end step -1
    $iPixel = BitAND(DllStructGetData($tPixel, 1, 1 + $iX + ($iY * $iW)), 1) ;get pixel color
    $iBits &= $iPixel
    $iVal += $iPixel * 2 ^ (7 - $z) ; THIS little trick converts it to a number... NICE touch...
    $z += 1
    If $z = 8 Then
    $aBytes[$y] = 255-$iVal ; final output needs to be reversed in color
    $y += 1
    $iVal = 0
    $iBits = ""
    $z = 0
    EndIf
    Next ; height
    Next ; byteblock
    Next
    _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) ;unlocks a portion of a bitmap that was locked by _GDIPlus_BitmapLockBits
    Return $aBytes
    EndFunc ;==>BitmapToBinary

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Dateien

    template.zip 26,03 kB – 372 Downloads
  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 5. Februar 2014 um 10:24

    Ich entschuldige, meine Erklärung war (von Anfang an) zu schlecht... :wacko:

    Also..
    Sehe Dateien im Anhang.

    Ausgangspunkt ist eine 1 bpp BMP, dort sind die Pixel in Bytes gespeichert, von unten Links, nach Oben Rechts. So weit klar.
    Eine 16 x 32 pixel Bild hat 32 Reien á 2 Bytes = 16 bit. Erste Reihe wird dann 0b1000000 = 0x80 (oder, in einige Fälle 0b01111111 = 0x7F).

    Ich möchte gern das Bild SPALTENWEISE lesen, so das ich 16 x 4 Bytes (16 x 32 pixel) im Enddatei habe. Note: Im Enddatei ist auch Metadata, das habe ich im Griff.

    Bitrotation und BitAnd/Or ist mir klar, wenn nötig. Ich kann auch schon die Pixel einzeln auslesen, GetPixel ist aber viel zu langsam.

    Es ist warscheinlich sehr einfach, und ich habe irgendwas verpasst. Aber dann werde ich hoffenlich zulernen.

    Die Delphi-code dafür habe ich, auch im Anhang.

    Ist es möglich - ohne GetPixel ?

    Dateien

    2014-02-05_100017.jpg 78,41 kB – 0 Downloads 2014-02-05_095858.jpg 160,72 kB – 0 Downloads delphicode.txt 1,04 kB – 426 Downloads
  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 4. Februar 2014 um 15:12

    Ja, genau dieses Beispiel habe ich auch benutzt. Es geht auch, aber ist aus meiner sicht sehr langsam.

    Ich habe anderswo eine trick gesehen mit fileread() und StringMid(), immerhin ist die 1-Bit BMP sehr einfach. Leider kriege ich es nicht hin. :cursing:

  • Pixeln aus 1bit BMP auslesen - vertikal (Scanlines emulieren)

    • myicq
    • 4. Februar 2014 um 14:29

    Hallo,

    ich möchte gern aus eine BMP (1bit) die Pixeln auslesen, und zwar so das ich für alle 8 pixel 1 Byte erstelle.
    Mein bild hat immer 32*x , 32*y pixel, und ich werde mein Bild von ObenLinks nach UntenRechts lesen.

    Also: wenn die ersten Pixel Oben links so aussehen:

    Spoiler anzeigen
    Code
    o...
    o...
    o...
    o...
    o...
    o...
    X...
    X...


    werde ich (irgendwie) in Binär 0b11000000 haben (möchten!) oder 0xC0 in mein Endergebnis haben.

    Ich versuche eine Procedure in Delphi nachzumachen. In Delphi wird Scanlines verwendet. Leider hat AutoIT3 kein Scanline, so weit ich das sehe.

    So weit bin ich gekommen: es geht, aber ist relativ langsam: 11-14 Sekunden. Problem ist warscheinlich, ich lese 32 Bit obwohl min Bild nur 8 Bit ist.

    Spoiler anzeigen
    [autoit]


    #include <Constants.au3>
    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Example()

    [/autoit] [autoit][/autoit] [autoit]

    Func Example()

    [/autoit] [autoit][/autoit] [autoit]

    Local $sFile = @ScriptDir & "\template.bmp"

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) ;create an image object based on a file

    [/autoit] [autoit][/autoit] [autoit]

    Local $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) ;get width and height of the image

    [/autoit] [autoit][/autoit] [autoit]

    ; what is difference between bitmap and image ?
    Local $hBitmap = _GDIPlus_BitmapCreateFromFile($sFile)

    [/autoit] [autoit][/autoit] [autoit]

    Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB) ;locks a portion of a bitmap for reading and writing. More infor at http://msdn.microsoft.com/en-us/library/…8(v=vs.85).aspx

    [/autoit] [autoit][/autoit] [autoit]

    Local $iScan0 = DllStructGetData($tBitmapData, "Scan0") ;get scan0 (pixel data) from locked bitmap

    ; the struct must match the format of pixel data...
    Local $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0)

    [/autoit] [autoit][/autoit] [autoit]

    Local $iPixel, $iRowOffset
    Local $out = ""

    [/autoit] [autoit][/autoit] [autoit]

    $t = TimerInit()

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("Struct size " & DllStructGetSize($tPixel) & @LF)
    ; Read vertically...
    ; go over each column
    For $myColumn = 1 To $iH
    ; then for each row
    For $myRow = 1 To $iW
    ; index starts at 1
    ; pixel at col 1, row 2 is at 1 + iW
    $pixelIndex = ($myRow - 1) * $iW + $myColumn
    ;~ ConsoleWrite("col =" & $myColumn & ", row = " & $myrow & " : " & $pixelIndex & @LF)
    ; USE: DllStructGetData ( Struct, Element [, index = Default]

    [/autoit] [autoit][/autoit] [autoit]

    $iPixel = DllStructGetData($tPixel, 1, $pixelIndex) ;get pixel color
    $out &=hex($iPixel)& @CRLF
    Next
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite("Reading vertically ==> " & TimerDiff($t) & @LF)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) ;unlocks a portion of a bitmap that was locked by _GDIPlus_BitmapLockBits
    FileDelete(@ScriptDir & "\pixels.txt")
    FileWrite(@ScriptDir & "\pixels.txt", $out)

    [/autoit] [autoit][/autoit] [autoit]

    ;cleanup resources
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>Example

    [/autoit]

    Ich habe Beispiel "template.bmp" im Anhang.

    Bei Delphi dauert dieser Procedur nur wenige Sekunden.

    PS: Deutsch ist nicht meine Muttersprache, entschuldige Sprachfehler... :S

  • _DateDayOfWeekML

    • myicq
    • 17. September 2013 um 11:02

    Windows hat eine API für Locales. Warum nicht einfach Windows abfragen was zB "Montag" ist auf Swahili, Ungarish oder Urdu ? Das würde viel programmierung ersparen.

  • GUI mit MS-Access Datenbank

    • myicq
    • 15. August 2012 um 12:01

    Danke!
    Jetzt habe ich ENDLICH herausgefunden wie ich mit MS Access 2007 kommuniziere. Jedenfalls durch ODBC.

  • Konvertierung von Labeldesign- SW Objekte (SysTreeView32 etc) zu XML

    • myicq
    • 2. Dezember 2011 um 14:30

    Ich suche (dringend) eine(n) Programmierer(in) für das folgende Projekt:

    Ca. 4200 Etiketten sind in einer Labeldesign-SW gespeichert, jetzt müssen die Objekte exportiert werden.
    Es ist möglich, die Objekte in einem SysTreeView32- Objekt zu sehen.

    Aufgabe:

    Etikett öffnen
    Liste der Objekte durchgehen
    Pro Objekt sind die Eigenschaften zu extrahieren. Das geschieht über ein Fenster mit Class: Edit oder Class: SysTreeView32 controls
    Etikett-Eigenschaften extrahieren (Größe)
    Etikett schliessen

    Eigenschaften sind:
    * Inhalt
    * Position
    * Größe (Breite und Höhe)
    * Schriftart
    * Schriftgröße
    * Rotation
    * wenn möglich mehr Eigenschaften.

    Die Daten (Etikett, Objekt, Eigenschaften) müssen strukturiert hinterlegt werden. Am besten in XML-Format, nach Absprache

    Der Kunde ist bereit, dafür (gut) zu zahlen. Alternativ währe Manuell alles zu tun.
    Projekt ist dringend !

    [Blockierte Grafik: http://img716.imageshack.us/img716/2485/labelctl20111202143425.png]

  • UDF für login (pincode)

    • myicq
    • 15. November 2011 um 00:38
    Zitat von Mattthias

    Ich glaube er will eher einen "Sperren" Screen.
    Aber davon gibts hier auch genug ...

    Nicht ganz so wie im USB-sperre. Eher: vor Nutzung einer Applikation muss der Anwender sich anmelden (über PIN)

    Es geht hier nur um eine Beispiel, absoluter Sicherheit ist deshalb nicht erforderlich.

    Ich werde dann warscheinlich irgendwas basteln... :D

  • UDF für login (pincode)

    • myicq
    • 14. November 2011 um 22:37

    Ich denke so etwas muss es irgendwo geben, hab's nur noch nicht gefunden.

    Also.. ich suche eine UDF / Quellkode womit ich eine funktion abrufen kann, wie zB

    [autoit]


    if not (_get_pin("4")) >0 then ... ; 4 digits, default 3 retries

    [/autoit]

    damit eine Fenster sich öffnet und der nutzer gezwungen wird eine PIN-code einzugeben. Diese Fenster muss eine Zahlen-Block anzeigen für Touch-Screens.
    Ähnlich wie das hier (muss nicht unbedingt so aussehen, aber vom Funktion her... )

    Ich schaffe wohl das selbst zu machen, aber gibt es schon solche UDFs ?

    Evtl einige die ich als Anfang nutzen könnte ?

    Danke Im Voraus.

    PS: Deutsch ist nicht meine Muttersprache. :S

  • Legacy / Nicht-PnP Treiber unter Win7 installieren ?

    • myicq
    • 30. Januar 2011 um 22:23

    Kunden von mir müssen eine Nicht-PnP treiber unter Win7 installieren. Es geht, aber ist kompliziert. Geht das über AutoIt3 einfacher ? Ich habe alle .INF etc.

    Danke für jeder Hilfe.

  • "Lokale" Monats- und Tagesnamen

    • myicq
    • 14. Oktober 2010 um 22:30

    Die Locales (Monats / Tagnamen) sind standardisiert.. es sollte also kein großes Thema sein (fast) alle Locales in eine UDF einzulegen.

    Dann sollte man Funktionen wie

    [autoit]

    _NameOfMonth("02" , "daDK") => februar
    _NameOfDay("2012/02/28","daDK") => mandag

    [/autoit]

    nutzen können.


    Oder gibt es schon so was ?

    PS: Meine Muttersprache ist Dänish, deshalb vorbehalt für Fehler...:)

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™