Ich bins wieder
Und diesmal mit folgendem Problem:
Ich hab ein Bild (Anhang), indem manche Teile rot sind (0xFF0000).
Die roten Teile will ich transparent erscheinen lassen.
Das Bild wird mit GDi+ gezeichnet (also eine Graphik).
Mit der SuFu hab ich nicht wirklich was brauchbares gefunden.
Ich Danke euch schonmal für die Antworten.
MfG
H2112
PS: Script:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>
#Include <WinAPI.au3>
#include <Array.au3>
_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]Global $hImage = _GDIPlus_BitmapCreateFromFile("DieWelt.png")
Global $hBitmapWidht = _GDIPlus_ImageGetWidth($hImage), $hBitmapHeight = _GDIPlus_ImageGetHeight($hImage), $PicZahl = $hBitmapWidht / 16 * $hBitmapHeight / 16
Global $hBitmap, $hGraphic, $hGUI, $hImage, $hSplit[$PicZahl]
Global $Widht = 0, $High = 0
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate("Bildteiler", 580 + $hBitmapWidht / 16, 356 + $hBitmapHeight / 16)
GUISetBkColor(0x00FF00, $hGUI)
GUISetState()
For $i = 0 To $PicZahl -1 Step + 1
If $Widht <> $hBitmapWidht Then
$hSplit[$i] = _GDIPlus_BitmapCloneArea($hImage, $Widht, $High, 16, 16)
$Widht = $Widht + 16
Else
$Widht = 0
$High = $High + 16
$i = $i - 1
EndIf
Next
$Widht = 0
$High = 0
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
For $i = 0 To $PicZahl -1 Step + 1
If $Widht <> $hBitmapWidht + $hBitmapWidht / 16 Then
_GDIPlus_GraphicsDrawImage($hGraphic, $hSplit[$i], 50 + $Widht, 50 + $High)
$Widht = $Widht + 16 + 1
Else
$Widht = 0
$High = $High + 16 + 1
$i = $i - 1
EndIf
Next
$Widht = 0
$High = 0
Do
For $i = 0 To $PicZahl -1 Step + 1
If $Widht <> $hBitmapWidht + $hBitmapWidht / 16 Then
_GDIPlus_GraphicsDrawImage($hGraphic, $hSplit[$i], 50 + $Widht, 50 + $High)
$Widht = $Widht + 16 + 1
Else
$Widht = 0
$High = $High + 16 + 1
$i = $i - 1
EndIf
Next
$Widht = 0
$High = 0
Until GUIGetMsg() = $GUI_EVENT_CLOSE
_GDIPlus_GraphicsDispose($hGraphic)
_WinAPI_DeleteObject($hImage)
_GDIPlus_Shutdown()
[/autoit]