Текущий архив: 2003.12.23;
Скачать: CL | DM;
Вниз
Как можно реализовать плавное проявление изображения bmp? Найти похожие ветки
← →
kta © (2003-12-09 16:42) [0]Собственно весь вопрос в теме...
← →
хз © (2003-12-09 17:02) [1]Есть процедурка, но она плавно преобразует одно изображение в другое. Думаю переделать ее под свои нужды не так уж сложно...
Procedure Morph(Bmp,ToBmp:TBitMap;Count:Integer;BmpCanvas:TCanvas);
var
i: integer;
x, y: integer;
bm: TBitMap;
p1, p2, p: PByteArray;
begin
bm := TBitMap.Create;
if Bmp.Height < ToBmp.Height then
begin
bm.Height := Bmp.Height;
ToBmp.Height := Bmp.Height;
end
else
Begin
bm.Height := ToBmp.Height;
Bmp.Height := ToBmp.Height;
end;
if Bmp.Width < ToBmp.Width then
begin
bm.Width := Bmp.Width;
ToBmp.Width := Bmp.Width;
end
else
begin
bm.Width := ToBmp.Width;
Bmp.Width := ToBmp.Width;
end;
bm.PixelFormat := pf24bit;
Bmp.PixelFormat := pf24bit;
ToBmp.PixelFormat := pf24bit;
BmpCanvas.Draw(0, 0, Bmp);
for i := 1 to count - 1 do
begin
for y := 0 to bm.Height - 1 do
begin
p := bm.ScanLine[y];
p1 := Bmp.ScanLine[y];
p2 := ToBmp.ScanLine[y];
for x := 0 to bm.Width * 3 - 1 do
p^[x] := round((p1^[x] * (count - i) + p2^[x] * i) / count);
end;
BmpCanvas.Draw(0, 0, bm);
Application.ProcessMessages;
if Application.Terminated then
break;
end;
BmpCanvas.Draw(0, 0, ToBmp);
bm.Destroy;
End;
← →
kta © (2003-12-10 09:10) [2]Спасибо! Все получилось :))
Страницы: 1 вся ветка
Текущий архив: 2003.12.23;
Скачать: CL | DM;
Память: 0.47 MB
Время: 0.011 c