{ Bitmap implementation for Windows,
  Copr. 1996 Matthias Koeppe
}

uses WinProcs, WinGr, WinRes;

function BitmapToImage(ABitmap: PBitmap): pointer;
var
  Img: PImage;
begin
  New(Img);
  with Img^ do
  begin
    BkColor := TransColor(Bitmap.BkColor);
    Color := TransColor(Bitmap.Color);
    New(BitmapRef, Init(CreateBitmap(ABitmap^.bmWidth, ABitmap^.bmHeight,
      ABitmap^.bmPlanes, ABitmap^.bmBitsPixel div ABitmap^.bmPlanes,
      ABitmap^.bmBits)));
  end;
  BitmapToImage := Img
end;

function BitmapToImageWithUserPalette(ABitmap: PBitmap;
  UserPalette: pointer): pointer;
begin
  BitmapToImageWithUserPalette := BitmapToImage(ABitmap)
end;

procedure AddDevicePalette(ABitmap: PBitmap);
begin
end;

{ Palette functions
}

function GetNearestPaletteIndex(Color: TColorRef): Word;
begin
  GetNearestPaletteIndex := 0
end;

function RGB(Red, Green, Blue: Byte): TColorRef;
begin
  RGB := WinProcs.RGB(Red, Green, Blue);
end;

