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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Cannot save Image after changing brightness

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dracola Posted - Mar 17 2016 : 05:27:10
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
2   L A T E S T    R E P L I E S    (Newest First)
dracola Posted - Mar 17 2016 : 22:38:13
yeah it's work...
thanks a lot w2w for fast respond ^_^
w2m Posted - Mar 17 2016 : 09:07:56
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