ich will ein bild in eine Array laden nach dem ich es mittels Loadimageoder loadsprite funktion geladen habe. ich hab zwar das hier gefunden:
Code: Alles auswählen
Macro Red24( a ) : ((a) & $FF) : EndMacro
Macro Green24( a ) : ((a) >> 8 & $FF ): EndMacro
Macro Blue24( a ) : ((a) >> 16) : EndMacro
bmpInfo.BITMAPINFOHEADER
Dim myRGB.l(BMP_height-1,BMP_width-1) ;/// die x Ebene ist hier die Höhe und die y Ebene die Breite!!
hdc = GetDC_(#Null) ; 24Bit Screen
bmpInfo\biSize = SizeOf(BITMAPINFOHEADER) ; Set up the bmp header info
bmpInfo\biWidth = BMP_width
bmpInfo\biHeight = -BMP_height ; // Hier negativer Wert = Flip y axis
bmpInfo\biPlanes = 1
bmpInfo\biBitCount = 32
bmpInfo\biCompression = #BI_RGB
If GetDIBits_(hdc, hbmp, 0, BMP_height, @myRGB(), bmpInfo, #DIB_RGB_COLORS) ;// Bild wird hier in unser Array 'myRGB()' kopiert.
For x = 0 To BMP_width-1
For y = 0 To BMP_height-1
r = Red24(myRGB(y,x)) : g = Green24(myRGB(y,x)) : b = Blue24(myRGB(y,x))
MachWasMit(r) : MachWasMit(g) : MachWasMit(b)
Next y
Next x
EndIf
mfg