Hi
When LegacyBitmap = true then image table color miss sort order Because of this i Used mode LegacyBitmap = false then color palette its ok but problem in ResizrImage in mode LegacyBitmap = false
when LegacyBitmap = true then image resized but by very slow speed
load image :
// Don't use Windows Bitmaps
ImageEnView1.LegacyBitmap := false;
// Load images in native format
ImageEnView1.IO.NativePixelFormat := true;
with ImageEnView1.IO do
LoadFromFileBMP( ExecuteOpenDialog());
// if the bitmap is not 8 bit paletted then convert it
if ImageEnView1.IEBitmap.PixelFormat <> ie8p then
ImageEnView1.IEBitmap.PixelFormat := ie8p;
Resize (dont Resize in mode LegacyBitmap = False):
procedure TMainForm.Button1Click(Sender: TObject);
var
intHeight, intWidth: Integer;
begin
intHeight:= ImageEnView1.IO.Bitmap.Height ;
intWidth:= ImageEnView1.IO.Bitmap.WidtH;
if ((intWidth mod 2) <> 0) then
begin
ImageEnView1.Proc.Resample(intWidth + 1, intHeight);
Inc(intWidth);
end;
if ((intHeight mod 2) <> 0) then
begin
ImageEnView1.Proc.Resample(intWidth, intHeight + 1);
Inc(intHeight) ;
end;
intWidth:= intWidth div 2;
intHeight:= intHeight div 2;
ImageEnView1.Proc.ImageResize(intWidth, intHeight, iehLeft, ievBottom);
ImageEnView1.Proc.ConvertTo(ImageEnView1.Proc.CalcImageNumColors);
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.SaveToFileBMP('d:\Half.bmp');
end;
Please Help me , thanks