ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Resize Image in LegacyBitmap = False
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zavf

Iran
22 Posts

Posted - Jan 26 2019 :  13:25:42  Show Profile  Reply
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

xequte

38611 Posts

Posted - Jan 26 2019 :  15:56:30  Show Profile  Reply
Hi

I don't believe the issue here is the LegacyBitmap = true, which should not be slower during a resize (because the code is the same). I think it is the NativePixelFormat = True.

Do you need to set that?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

zavf

Iran
22 Posts

Posted - Jan 27 2019 :  09:29:12  Show Profile  Reply

Thanks

Major my problem with great your image component its missed color table sort order (in 8 , 4 bit Bitmap) after save / after resize

Do you help solve this problem? I also asked for this problem on this subject
https://www.imageen.com/ieforum/topic.asp?TOPIC_ID=3744
Go to Top of Page

xequte

38611 Posts

Posted - Jan 27 2019 :  17:20:30  Show Profile  Reply
I'll be investigating that shortly.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: