Podmiana Palety

Wycinanie palety

program pal;
uses crt;
var 
   zero,red,green,blue:char;
   x:byte;
   src,trg:text;
begin
   if paramcount<>2 then halt(1);
   assign(src,paramstr(1));
   assign(trg,paramstr(2));
   reset(src);
   rewrite(trg);
   for x:=0 to 53 do read(src,zero);
   for x:=0 to 255 do begin
      read(src,blue,green,red,zero);
      writeln(trg,'db ',ord(red) shr 2,',',ord(green) shr 2,',',ord(blue) shr 2);
   end;
   close(src);
   close(trg);
end.

Ustawianie palety

procedure paleta
asm
   mov cx,256*3 ; {ustawia 256 kolorów}
   mov dx,3c8h
   mov al,0     ; {zacznij od zera}
   out dx,al
   inc dx
   rep outsb    ;{wysyłaj dane do portu}
end;

Podobne strony

Podobne Strony
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License