Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Вертикальное выравнивание изображение внутри div-а

// HTML при этом выглядит так
// <div class="image"><span></span><img src="..."></div>

.image {margin:0 0 30px 30px; width:168px; height:168px; display: table-cell; text-align: center; vertical-align: middle;}
.image * {vertical-align: middle;}
.image {display: block;}
.image span {display: inline-block; height: 100%;width: 1px;}
.image img {padding:3px; border:1px solid #ececec;}

Flip Vertical

Procedura odbija bitmapę względem osi X
procedure FlipVertical(var Bitmap:TBitmap);
var
ByteTop,ByteBottom:^Byte;
ByteTemp:Byte;
H,V:Integer;
begin
for V:=0 to (Bitmap.Height -1 ) div 2 do
  begin
  ByteTop:=Bitmap.ScanLine[V];
  ByteBottom:=Bitmap.ScanLine[Bitmap.Height -1-V];
  for H:=0 to Bitmap.Width *3 -1 do
    begin
    ByteTemp:=ByteTop^;
    ByteTop^:=ByteBottom^;
    ByteBottom^:=ByteTemp;
    inc(ByteTop);
    inc(ByteBottom);
    end;
  end;
end;de