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 Image Problem
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

sungho

Korea
14 Posts

Posted - Feb 11 2013 :  21:17:53  Show Profile  Reply
Hello.
And I have a question.

OS : Windows 7
C++ Builder XE
ImageEn v4.1.4

1. Load Image
2. change Whitevale, BlackValue
3. Save Change Image

Process 1, 2 is OK
Porcess 3 is not OK

Below Code
// OK
this->ImageEnView1->IO->LoadFromFileBMP("d:\\test.bmp");
// OK
ImageEnView1->Proc->Flip(fdHorizontal);
// save Flip image OK
this->ImageEnView1->IO->SaveToFile("d:\\test-hori.bmp");

// effect BlackValue, WhiteValue
this->ImageEnView1->IO->IEBitmap->BlackValue = 100;
this->ImageEnView1->IO->IEBitmap->WhiteValue = 20;
this->ImageEnView1->IO->Update();

// save image is before Flip image.
this->ImageEnView1->IO->SaveToFile("d:\\test-wh.bmp");

I want save adapt BlackValue/WhiteValue image.

Best Regards.
Thanks.

fab

1310 Posts

Posted - Feb 12 2013 :  10:24:47  Show Profile  Reply
TIEBitmap.BlackValue and WhiteValue cannot be saved. They are "display-only" properties (like ChannelOffset and Contrast).
To make permanent changes to the image you have to call StretchValues after set BlackValue and WhiteValue.
Example:

this->ImageEnView1->IO->IEBitmap->BlackValue = 100;
this->ImageEnView1->IO->IEBitmap->WhiteValue = 20;
this->ImageEnView1->IO->IEBitmap->StretchValues();
this->ImageEnView1->IO->Update();
Go to Top of Page

sungho

Korea
14 Posts

Posted - Feb 12 2013 :  10:45:04  Show Profile  Reply
Thanks to fast reply.

Your suggest code execute result is full white image.
(View Screen and save result image file)
this->ImageEnView1->IO->IEBitmap->BlackValue = 100;
this->ImageEnView1->IO->IEBitmap->WhiteValue = 20;
this->ImageEnView1->IO->IEBitmap->StretchValues();
this->ImageEnView1->IO->Update();

Below code is good effect image.
(View Screen and not effect result image file)
this->ImageEnView1->IO->IEBitmap->BlackValue = 100;
this->ImageEnView1->IO->IEBitmap->WhiteValue = 20;
this->ImageEnView1->IO->Update();

OS : Windows7 Prof
C++ Builder Xe
ImageEn v4.1.4

Thanks
Best Regards.
Go to Top of Page

fab

1310 Posts

Posted - Feb 12 2013 :  14:24:16  Show Profile  Reply
BlackValue should be less than WhiteValue.
Go to Top of Page

sungho

Korea
14 Posts

Posted - Feb 12 2013 :  18:24:49  Show Profile  Reply
Thanks fast Reply.
Your suggest is correct.
Best Regards.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: