Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
14-75341
LLL
2003-12-01 01:34
2003.12.23
Функции


1-75182
NeedHELP
2003-12-11 15:53
2003.12.23
Incompatible types: WideString and PAnsiChar


3-75105
Glaz
2003-11-29 13:11
2003.12.23
Как сохранять изображения в IBase


3-75120
Evyshka
2003-11-28 11:49
2003.12.23
Обновление на основе двух таблиц


1-75166
Matrixxx
2003-12-09 18:17
2003.12.23
Дана матрица




   Наверх