Seite 1 von 5

img2ascii v1.07

Verfasst: 17.08.2007 17:48
von RiSiNG
Bild

~ a program, which converts images to ascii's

~ Download

Changes v1.07:
- [changed] menu
- [added] default options
- [added] a save-requester pattern addition
- [fixed] bug in text-conversion
- [fixed] bug in gui with win2k or winxp without skins
- [fixed] another gui addition

Changes v1.05:
- [added] font-size
- [added] char-distance x,y
- [added] gui-changes
- [added] several small fixes
- [fixed] gui
- [fixed] bug in image-conversion
- [fixed] bug in html-conversion

Changes v1.03:
- [added] image-rotation
- [added] output-size in pixel will be shown
if it is to large -> colorized red and the conversion will not start
- [added] option "Delete output file(s) when exit"
- [added] greetz in about-requester
- [added] several fixes & small additions
- [extended] menu -> configuration
- [extended] extended help -> help

Verfasst: 17.08.2007 18:41
von Ground0
Das ist mal ein wircklich wircklich cooles Progrämchen :)

MAch spass, noch ein paar features wie

- Characters (Mode1 / Mode 2) Verändern
- Farbintensität festlegen.. bei mir kommt es zu hell heraus.
- Abstände zwischen den buchstaben regelbar...

So das wärs soweit gewesen... aber ansonsten wircklich super und schnell :D

Gruss G0

Verfasst: 17.08.2007 18:52
von rolaf
WoW - Das gefällt... :allright:

Verfasst: 17.08.2007 18:56
von X0r
Ich finde das Programm auch ganz gut. Macht wirklich Spaß damit rumzuspielen.

In der About-MessageBox steht ...written in 2007 by RiSing. Würde man glaube ich nicht sagen. Unter Written in.. würde man die Programmiersprache, in der du dein Programm geschrieben hast, verstehen.
Liege ich falsch, Fluid Byte?

Verfasst: 17.08.2007 18:59
von RiSiNG
Danke erstmal für das Feedback!
Hmm X0r, aber dann sag mir aber bitte wie mans anders schreibt?

Verfasst: 17.08.2007 19:14
von Vermilion
Find ich toll <)

Verfasst: 18.08.2007 19:05
von RiSiNG
img2ascii v1.03 released!

Changes v1.03:
- [added] image-rotation
- [added] output-size in pixel will be shown
if it is to large -> colorized red and the conversion will not start
- [added] option "Delete output file(s) when exit"
- [added] greetz in about-requester
- [added] several fixes & small additions

- [extended] menu -> configuration
- [extended] extended help -> help

Verfasst: 18.08.2007 22:05
von Bisonte
Cooles Proggie... :allright:
Als alter Mailboxabkömmling ... genial sach ich da ;)

Hiess das nicht "written by" und "Copyright in 2007 by" ?

Verfasst: 18.08.2007 23:19
von kutta
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....
hier mal mein code als anregung

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)

Grüsse

Verfasst: 19.08.2007 07:27
von RiSiNG
kutta hat geschrieben:aber wenn man deins als html ausgeben könnt wärs richtig cool denk mal drüber nach....
Geht das etwa nicht? (..."Output-Format: HTML")