Показать сообщение отдельно
  #10  
Старый 21.12.2012, 19:28
Аватар для Algplux
Algplux Algplux вне форума
Прохожий
 
Регистрация: 03.11.2012
Адрес: Березники, Пермский край
Сообщения: 20
Версия Delphi: 7
Репутация: 10
По умолчанию

Ребята, извините что пропал. Тема актуальна ещё. Из за работы времени на курсач совсем не было. Решил с компонентом пока не замарачиваться, Всё просто в программе написать. Сейчас ищу нужные функции. Парочка уже есть:

Код:
function ByteLimit(Value: Integer): Byte;
begin
 if Value < 0 then
   Result := 0
 else if Value > 255 then
   Result := 255
 else
   Result := Value;
end;

procedure LightDark24Bit(Bmp: TBitmap; Value: Integer);
{
Сделать светлее - Value > 0
Cделать темнее  - Value < 0
}
var
P               : PByteArray;
X, Y            : Integer;
BytesInScanLine : Integer;
DIB             : TDIBSection;
begin
if (Bmp.PixelFormat = pf24Bit) and
   (GetObject(Bmp.Handle, SizeOf(DIB), @DIB) = SizeOf(DIB)) and
   (DIB.dsBmih.biHeight > 0) and (Value <> 0) then
begin
  BytesInScanLine := (((DIB.dsBmih.biWidth * DIB.dsBmih.biBitCount) + 31) and not 31) div 8;
  P := DIB.dsBm.bmBits;
  for Y := DIB.dsBmih.biHeight - 1 downto 0 do
  begin
    for X := 0 to (DIB.dsBmih.biWidth - 1) * 3 do
      P[X] := ByteLimit(P[X] + Value);
    Integer(P) := Integer(P) + BytesInScanLine;
  end;
end;
end;
Как мне её реализовать?
Ответить с цитированием