You could check ImageEnView1.IEBitmap.PixelFormat:
case ImageEnView1.PixelFormat of
ie1g:
begin
ImageEnView1.IO.Params.BitsPerSample := 1;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
end;
ie8p, ie8g:
begin
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
end;
ie16g:
begin
ImageEnView1.IO.Params.BitsPerSample := 16;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
end;
ie24RGB, ie32RGB, ieCIELab:
begin
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 3;
end;
ie32f:
begin
ImageEnView1.IO.Params.BitsPerSample := 32;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
end;
ieCMYK:
begin
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 4;
end;
ie48RGB:
begin
ImageEnView1.IO.Params.BitsPerSample := 16;
ImageEnView1.IO.Params.SamplesPerPixel := 3;
end;
end;
if ImageEnView1.IEBitmap.HasAlphaChannel then
ImageEnView1.IO.Params.SamplesPerPixel := ImageEnView1.IO.Params.SamplesPerPixel + 1;