Einzelnen Beitrag anzeigen

Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#1

Bitmap to ASCII - blinkende Zeichen (Problemchen)

  Alt 27. Nov 2005, 14:05
Moin,

Ausgehend von diesem Thread Dos Animations von storm1988 dachte ich mir, muss ich auch mal wieder machen.

Soweit so gut, konverieren geht, aber leider sind im Vollbildmodus der Konsole blinkende Zeichen zu sehen. Diese wollte ich wiefolgt umgehen:

Delphi-Quellcode:
yy := 0;
  for y := 0 to 24 do
  begin
    for x := 0 to 79 do
    begin
      col1 := image.Picture.Bitmap.Canvas.Pixels[x,yy];
      col2 := image.Picture.Bitmap.Canvas.Pixels[x,yy+1];

      cl1 := GetColorIndex(GetRValue(Col1), GetGValue(Col1), GetBValue(Col1));
      cl2 := GetColorIndex(GetRValue(Col2), GetGValue(Col2), GetBValue(Col2));

      if cl1 = cl2 then
      begin
        TextAr[x,y].Ch := #219; // Vollblock
        TextAr[x,y].Color := cl1; // nur Vordergrundfarbe setzen
      end;

      if (cl1 > cl2) and (cl1<=15) and (cl2<=7)then
      begin
        TextAr[x,y].Ch := #223; // Halbblock oben
        TextAr[x,y].Color := TextColor(cl1) + TextBackground(cl2);
      end;
      if (cl1 > cl2) and (cl1<=15) and (cl2>7)then
      begin
        TextAr[x,y].Ch := #220; // Halbblock unten
        TextAr[x,y].Color := TextColor(cl2) + TextBackground(cl1);
      end;

      if (cl1 < cl2) and (cl1<=15) and (cl2<=7)then
      begin
        TextAr[x,y].Ch := #223; // Halbblock oben
        TextAr[x,y].Color := TextColor(cl1) + TextBackground(cl2);
      end;
      if (cl1 < cl2) and (cl1<=15) and (cl2>7)then
      begin
        TextAr[x,y].Ch := #220; // Halbblock unten
        TextAr[x,y].Color := TextColor(cl2) + TextBackground(cl1);
      end;


    end;
    inc(yy, 2);
  end;
GetColorIndex() gibt den Wert der Farbe eines Pixels als Zeichenfarbe zurück

Das funktioniert nur Teilweise, kann mir jemand bei diesem Problem helfen ?
Angehängte Dateien
Dateityp: zip bmptoascii_186.zip (70,3 KB, 28x aufgerufen)
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat