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
 Bitmap Bug
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jeffp

USA
74 Posts

Posted - Aug 04 2026 :  16:05:35  Show Profile  Reply
The two options below should produce the same result. However, with the "Test.bmp" file attached as the Input ABitmap, option A produces a blank bmp while option B produces the correct result.


procedure TEST_BITMAP(ABitmap: TBitmap);
var
  MB: TIEMultiBitmap;
  B: TIEBitmap;
begin
  //Option A
  B := TIEBitmap.Create;
  try
    B.CopyFromTBitmap(ABitmap);
    B.SaveToFile('D:\Test5\TestA.bmp');
  finally
    B.Free;
  end;

  //Option B
  MB := TIEMultiBitmap.Create;
  try
    MB.InsertImage(0, ABitmap);
    B := MB.GetTIEBitmap(0);
    B.SaveToFile('D:\Test5\TestB.bmp');
  finally
    MB.ReleaseBitmap(0, False);
    MB.Free;
  end;
end;




attach/jeffp/20268416431_TestBitmap.zip
6432.53 KB

jp

xequte

39499 Posts

Posted - Aug 05 2026 :  17:56:29  Show Profile  Reply
Hi Jeff

You don't show your method for loading ABitmap. What is the value of ABitmap.PixelFormat?

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

jeffp

USA
74 Posts

Posted - Aug 05 2026 :  18:16:06  Show Profile  Reply
Value is pf32bit

jp
Go to Top of Page

xequte

39499 Posts

Posted - Aug 06 2026 :  15:41:03  Show Profile  Reply
Sorry, I need to be able to reproduce this when I get back to the office today.

Does it occur if you load like this?

var ABitmap := TBitmap.Create();
ABitmap.LoadFromFile( 'D:\test.bmp' );
TEST_BITMAP( ABitmap );
ABitmap.Free();


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

jeffp

USA
74 Posts

Posted - Aug 06 2026 :  17:41:14  Show Profile  Reply
Yes

jp
Go to Top of Page

xequte

39499 Posts

Posted - Aug 06 2026 :  23:34:50  Show Profile  Reply
Hi Jeff

OK, so this image is effectively blank. There is content in the RGB channels (two brown cards), but the Alpha channel is completely black, so "Option A", i.e. a blank output is correct.

At this point, TIEMultiBitmap does not support the A channel of 32bit RGBA images unless the alpha is synced:

http://www.imageen.com/help/TIEBitmap.SynchronizeRGBA.html

But I have added RGBA support when adding TBitmaps in the current beta (you can email me for it).

If you don't want the image to be blank (i.e. want to ignore the alpha channel), sync it (SynchronizeRGBA), then remove the alpha channel (without merging):

http://www.imageen.com/help/TIEBitmap.RemoveAlphaChannel.html

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