Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Delphi [игнор отключен] [закрыт для гостей] / Проблема с цветом курсора. / 1 сообщений из 1, страница 1 из 1
25.02.2021, 22:21
    #40048791
Страдалецъ
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Проблема с цветом курсора.
Создаю курсор на основе картинки из ImageList и наблюдаю что яркость курсора процентов на 10 больше. Копирую в Image эту-же картинку - все нормально. В чем засада? Курсор создаю так:
Код: pascal
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
procedure TForm1.SetDragCursor(ImageIndex: Integer);
var
  CursorBitmap, CursorMask: TBitmap;
  IconInfo: TIconInfo;
  Pixel: PRGBQuad;
  i,j: Integer;
begin
 CursorBitmap := TBitmap.Create;
 CursorBitmap.PixelFormat := pf32bit;
 CursorMask := TBitmap.Create;
 try
   ImageList1.GetBitmap(ImageIndex, CursorBitmap);
   CursorMask.SetSize(CursorBitmap.Width, CursorBitmap.Height);
   for i := 0 to (CursorBitmap.Height - 1)
   do begin
      Pixel := CursorBitmap.ScanLine[i];
      for j := 0 to CursorBitmap.Width - 1
      do begin
         if (Pixel.rgbRed = 255) and (Pixel.rgbGreen = 255) and (Pixel.rgbBlue = 255)
         then Pixel.rgbReserved := $00
         else Pixel.rgbReserved := $FF;
         Inc(Pixel);
         end;
      end;
   IconInfo.xHotspot := CursorBitmap.Width div 2;
   IconInfo.yHotspot := CursorBitmap.Height div 2;
   IconInfo.hbmMask := CursorMask.Handle;
   IconInfo.hbmColor := CursorBitmap.Handle;
   Screen.Cursors[crDrag] := CreateIconIndirect(IconInfo);
   Screen.Cursor := crDrag;
 finally
   CursorBitmap.Free;
   CursorMask.Free;
 end;
end;
...
Рейтинг: 0 / 0
Форумы / Delphi [игнор отключен] [закрыт для гостей] / Проблема с цветом курсора. / 1 сообщений из 1, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]