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
 Cannot save Image after changing brightness
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

dracola

Argentina
37 Posts

Posted - Mar 17 2016 :  05:27:10  Show Profile  Reply
Hi, i want to ask how to save image after changing brightness with
ImageEnView1.IEBitmap.ChannelOffset[0]

here my code :

//changing brightness according trackbar
brighttrackbar.Position:= brighttrackbar.Position+10;

ImageEnView1.IEBitmap.ChannelOffset[0]:=round(brighttrackbar.Position);
ImageEnView1.IEBitmap.ChannelOffset[1]:=round(brighttrackbar.Position);
ImageEnView1.IEBitmap.ChannelOffset[2]:=round(brighttrackbar.Position);

ImageEnView1.Update;

//save image

ImageEnView1.Proc.ClearAllUndo;
ImageEnView1.IO.SaveToFile('C:\Filename.jpg');

result saved image is the same as old image without changing on brightness.

when i uses : ImageEnView1.Proc.AdjustBrightnessContrastSaturation(brighttrackbar,0,0);
and then save, it's can save the change. But this code processing to long time, and result not as good using : ImageEnView1.IEBitmap.ChannelOffset[0].

how can i saved change with ImageEnView1.IEBitmap.ChannelOffset[0]

thank's & best rgds

w2m

USA
1990 Posts

Posted - Mar 17 2016 :  09:07:56  Show Profile  Reply
Changing the ChannelOffset only affects the displayed image so when saving the file the ChannelOffset values are not saved. To save the ChannelOffset or "brightness" to an image saved to a file you must call FixChannelOffset before saving the image.
procedure TForm1.SaveAs1Click(Sender: TObject);
begin
  if SavePictureDialog1.Execute then
  begin
    ImageEnView1.IEBitmap.FixChannelOffset();
    ImageEnView1.IO.SaveToFile(SavePictureDialog1.FileName);
  end;
end;

FixChannelOffset makes the ChannelOffset property permanent (applying specified offset). FixChannelOffset only works for ie24RGB, ie32RGB and ie48RGB pixel formats. The FixChannelOffset method resets ChannelOffset property values to zero.

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

dracola

Argentina
37 Posts

Posted - Mar 17 2016 :  22:38:13  Show Profile  Reply
yeah it's work...
thanks a lot w2w for fast respond ^_^
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: