Hi nettes proggie, hab da mal was ähnliches gemacht, jpg in html umwandeln leider läufts nur aufm IE aber wenn man deins als html ausgeben könnt wärs richtig cool denk mal drüber nach....
Code: Alles auswählen
OpenWindow(0,0,0,355,170,"PicIt",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
;Gadgets erzeugen
CreateGadgetList(WindowID(0))
ButtonGadget (1,10,10,150,20,"Text wählen")
ButtonGadget (2,10,40,150,20,"Bild wählen")
ButtonGadget (3,10,75,150,80,"Mix It !") :DisableGadget(3, 1)
SpinGadget (4, 300, 12, 30, 15, 5, 16 ):SetGadgetState(4, 10) : SetGadgetText(4, "10")
TextGadget (5, 220, 12, 80, 20, "Schriftgrösse ")
TrackBarGadget(6, 300, 42, 30, 20, 1, 35 ) : SetGadgetState(6, 1)
TextGadget (7, 170, 13, 20, 20, "")
TextGadget (8, 170, 43, 20, 20, "")
TextGadget (9, 220, 42, 80, 20, "Zeichenabstand ")
TextGadget (10, 335, 44, 80, 20, "5")
TextGadget (11, 220, 70, 80, 20, "Hintergrundfarbe ")
TrackBarGadget(12, 240, 105, 20, 30, 0, 255,#PB_TrackBar_Vertical) : SetGadgetState(12,0)
TrackBarGadget(13, 270, 105, 20, 30, 0, 255,#PB_TrackBar_Vertical) : SetGadgetState(13,0)
TrackBarGadget(14, 300, 105, 20, 30, 0, 255,#PB_TrackBar_Vertical) : SetGadgetState(14,0)
TextGadget (15, 245, 90, 20, 20, "R")
TextGadget (16, 275, 90, 20, 20, "G")
TextGadget (17, 305, 90, 20, 20, "B")
TextGadget (18, 242, 140, 20, 20, Str(GetGadgetState(12)))
TextGadget (19, 272, 140, 20, 20, Str(GetGadgetState(13)))
TextGadget (20, 302, 140, 20, 20, Str(GetGadgetState(14)))
Repeat
Event = WaitWindowEvent()
If EventGadget() = 4
SetGadgetText(4, Str(GetGadgetState(4)))
EndIf
If EventGadget() = 6
SetGadgetText(10, Str(GetGadgetState(6)))
EndIf
If EventGadget() = 12
SetGadgetText(18, Str(GetGadgetState(12)))
EndIf
If EventGadget() = 13
SetGadgetText(19, Str(GetGadgetState(13)))
EndIf
If EventGadget() = 14
SetGadgetText(20, Str(GetGadgetState(14)))
EndIf
If bildstatus=1 And textstatus=1 : DisableGadget(3, 0) :EndIf
;Text laden wenn schalfläche text laden gedrückt wird
If event=#WM_LBUTTONDOWN And WindowMouseX(0)>10 And WindowMouseX(0)<160 And WindowMouseY(0)>10 And WindowMouseY(0)<30
File$ = OpenFileRequester("Text laden","","Text (*.txt)|*.txt",0)
If File$<>""
SetGadgetText(7, "OK")
textstatus=1
EndIf
EndIf
;Bild laden wenn schalfläche bild laden gedrückt wird
If event=#WM_LBUTTONDOWN And WindowMouseX(0)>10 And WindowMouseX(0)<160 And WindowMouseY(0)>40 And WindowMouseY(0)<60
Bild$= OpenFileRequester("Bild laden","","Jpeg (*.jpg)|*.jpg|" ,0)
If Bild$<>""
SetGadgetText(8, "OK")
bildstatus=1
EndIf
EndIf
;Bild und Text vermischen wenn schaltflaäche mixit gedrückt wird
If event=#WM_LBUTTONDOWN And WindowMouseX(0)>10 And WindowMouseX(0)<160 And WindowMouseY(0)>75 And WindowMouseY(0)<155 And textstatus=1 And bildstatus=1
;text einlesen
ReadFile(0, File$)
While Eof(0) = 0
test$=ReadString(0)
If maxzeichenzahl < StringByteLength(test$, #PB_Ascii):maxzeichenzahl=StringByteLength(test$, #PB_Ascii)+1:EndIf
zeilenanzahl=zeilenanzahl+1
Wend
Dim zeile$(zeilenanzahl)
ReadFile(0, File$)
While Eof(0) = 0
zeile$(i)=ReadString(0)
i=i+1
Wend
CloseFile(0)
;bild einlesen
UseJPEGImageDecoder()
Dim farbinfo(maxzeichenzahl,zeilenanzahl)
LoadImage(0, Bild$)
ResizeImage(0, maxzeichenzahl, zeilenanzahl)
StartDrawing(ImageOutput(0))
For t=0 To zeilenanzahl
For s=0 To maxzeichenzahl
farbinfo(s,t)=Point(s,t)
Next
Next
StopDrawing()
;html file speichern
html$ = SaveFileRequester("",html$,"html | *.html",0)
If Right(html$,4)="html" : html$=Left(html$,StringByteLength(html$,#PB_Ascii)-5) : EndIf
If html$ <>""
CreateFile(1,html$ + ".html")
For a=0 To zeilenanzahl
WriteStringN(1,"<span style=font-size:" + Str(GetGadgetState(4)) + "pt ; style=letter-spacing:" + StrF(GetGadgetState(6)/10) + "px ; style=background-color:rgb(" + Str(GetGadgetState(12)) + "," + Str(GetGadgetState(13)) + "," + Str(GetGadgetState(14)) + ")>")
For b=1 To StringByteLength(zeile$(a), #PB_Ascii)
z$=z$+"<span style=color:rgb(" + Str(Red(farbinfo(b,a))) + "," + Str(Green(farbinfo(b,a))) + "," + Str(Blue(farbinfo(b,a))) + ")>" + Mid(zeile$(a), b,1)
Next
WriteStringN(1,z$+"</div><div style=line-height:" + Str(GetGadgetState(4)+2) + "px>")
z$=""
Next
CloseFile(1)
EndIf
i=0
maxzeichenzahl=0
zeilenanzahl=0
html$=""
EndIf
Until Event = #PB_Event_CloseWindow
!!! zum testen am besten erstmal n 40x40 zeichen textfile erstellen (so als block)