Habe mit Hilfe des PurebasicForum ein Programm zum Umwandeln von BMPGrafiken erstellt.
Ein BmpBild320x200 2Farbig wird einlesen und als "byte.bin" abgespeichert.
Dieses kann man jetzt im MODE 2 einlesen:
Load"byte.bin",&c000
Kann man auch leicht umwandeln für "FreeBasic".
Code
Global ByteInhalt.c,Staffel.l,Linie.l,ByteStueck.l,EinzelBit.l,zz.l
InitSprite()
OpenWindow(0,0,0,800,600,"cpctest",#PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),10,10,700,400,0,0,0)
OpenConsole()
ClearScreen(RGB(255,255,0))
LoadSprite(0, "cpctest.bmp", #PB_Sprite_Texture)
DisplaySprite(0,0,0)
Repeat
Event.l = WindowEvent()
If GetAsyncKeyState_(#VK_Q)
If CreateFile(0, "byte.bin")
PrintN("es gehtlos..")
StartDrawing(SpriteOutput(0))
For Staffel = 0 To 7
For Linie = 0 To 24
For ByteStueck = 0 To 79
ByteInhalt = 0
For EinzelBit = 0 To 7
If Point( ByteStueck * 8 + 7 - Einzelbit , Linie * 8 + Staffel )
ByteInhalt + ( 1 << Einzelbit )
EndIf
Next
WriteCharacter(0, ByteInhalt)
Next
Next
ByteInhalt=0
For zz=0 To 47
WriteCharacter(0, Byteinhalt)
Next
Next
EndIf
StopDrawing()
CloseFile(0)
PrintN("fertig...")
EndIf
FlipBuffers()
Until Event = #PB_Event_CloseWindow
End
Alles anzeigen