Форум: "Основная";
Текущий архив: 2003.05.12;
Скачать: [xml.tar.bz2];
ВнизКак засерить иконку? Найти похожие ветки
← →
kull (2003-04-29 15:17) [0]В смысле сделать ее серой. :)
← →
Anatoly Podgoretsky (2003-04-29 15:30) [1]FillRect
← →
kull (2003-04-29 15:36) [2]Неееее.... Не так... Надо чтобы она была типа Enabled = False
← →
REA (2003-04-29 15:36) [3]ImageList_Draw может быть полезно,
еще что-то видел с Bitmap - склероз.
← →
Anatoly Podgoretsky (2003-04-29 15:56) [4]CopyMode/Draw/CopyRect etc
← →
kull (2003-04-29 16:16) [5]Спасибо, народ! Вроде получилось....
← →
NAlexey (2003-04-29 16:56) [6]Можно так сделать:
procedure TForm1.Button1Click(Sender: TObject);
type
PColors = ^TColors;
TColors = array[0..MaxInt - 1] of Byte;
var
BI: TBitmapInfo;
W, H: integer;
function GetBitmapColors(ABitmap: HBITMAP): PColors;
begin
with BI.bmiHeader do
begin
biSize := SizeOf(BI.bmiHeader);
biWidth := W;
biHeight := -H;
biPlanes := 1;
biBitCount := 32;
biCompression := BI_RGB;
GetMem(Result, 4 * W * H);
GetDIBits(Image1.Canvas.Handle, ABitmap, 0, H, Result, BI, DIB_RGB_COLORS);
end;
end;
procedure SetBitmapColors(ABitmap: HBITMAP; AColors: PColors);
begin
SetDIBits(Image1.Canvas.Handle, ABitmap, 0, H, AColors, BI, DIB_RGB_COLORS);
FreeMem(AColors);
end;
procedure CreateGrayScaleBitmap;
var
Colors: PColors;
I, J, K: Integer;
AColor: COLORREF;
begin
Colors := GetBitmapColors(Image1.Picture.Bitmap.Handle);
try
for I := 0 to W - 1 do
for J := 0 to H - 1 do
begin
K := (J * W + I) * 4;
AColor := (Colors^[K] + Colors^[K + 1] + Colors^[K + 2]) div 3;
Colors^[K] := AColor;
Colors^[K + 1] := AColor;
Colors^[K + 2] := AColor;
end;
finally
SetBitmapColors(Image1.Picture.Bitmap.Handle, Colors);
end;
end;
begin
W := Image1.Picture.Bitmap.Width;
H := Image1.Picture.Bitmap.Height;
CreateGrayScaleBitmap;
Image1.Invalidate;
end;
← →
wicked (2003-04-29 19:49) [7]глянь на DrawState в msdn....
← →
Плохой человек (2003-04-29 21:09) [8]Нужно каждую чётную клеточку инвертировать - тогда получится такой эффект.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2003.05.12;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.006 c