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
 Save 32bit Bitmap With Transparency
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Nov 29 2014 :  09:47:38  Show Profile  Reply
I often have problems when trying to save an image as a 32-bit bitmap with transparency. Here is what I am trying, but when the image is opened after saving it, it is not transparent with imageen or with other applications:

if SavePictureDialog1.Execute then
begin
  Screen.Cursor := crHourGlass;
  try
     iFilename := SavePictureDialog1.FileName;
     ImageEnView1.IO.Params.BMP_HandleTransparency := True;
     ImageEnView1.IO.Params.BitsPerSample := 8;
     ImageEnView1.IO.Params.SamplesPerPixel := 4;
     iRGB := ImageEnView1.IEBitmap.Pixels[0,    
     ImageEnView1.IEBitmap.Height - 1];
     ImageEnView1.Proc.SetTransparentColors(iRGB, iRGB, 0);
     ImageEnView1.Update;
     iExtension := ExtractFileExt(iFilename);
     iIOFileType := IEExtToFileFormat(iExtension);
     ImageEnView1.IO.Params.FileType := iIOFileType;
     if iIOFileType <> ioICO then
     begin
       ImageEnView1.IO.PreviewsParams := [ioppDefaultLockPreview];
       if ImageEnView1.IO.DoPreviews([ppAuto]) then
         ImageEnView1.IO.SaveToFile(iFilename);
     end;
  finally
    Screen.Cursor := crDefault;
  end;
end;


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

39142 Posts

Posted - Nov 30 2014 :  03:27:05  Show Profile  Reply
Hi Bill

What file type are you saving to? PNG?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Nov 30 2014 :  06:52:30  Show Profile  Reply
No bmp... I never have problem with png... I guess it is because it is a bitmap.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39142 Posts

Posted - Dec 01 2014 :  02:40:23  Show Profile  Reply
Hi

Theoretically 32bit BMP files should support transparency, but for all practical purposes it does not.



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