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
 layer question
 New Topic  Reply to Topic
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

xequte

38127 Posts

Posted - May 19 2020 :  16:44:57  Show Profile  Reply
Hi

Those sounds like methods where you are calling the code to make the change, so the most efficient way is just to call your update code after completing the operation.

Otherwise use the OnImageChangeEx event and look for Proc changes, for example.

https://www.imageen.com/help/TImageEnView.OnImageChangeEx.html

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

pierrotsc

USA
497 Posts

Posted - May 19 2020 :  17:31:03  Show Profile  Reply
I was talking about the built-in image processes that has a gui built-in to modify an image. I will look at the help section. Thank
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 20 2020 :  20:03:09  Show Profile  Reply
Nigel, how should i handle a statement like that to be sure it sticks to the layer? (Red for example)
imageenview.IEBitmap.FixContrast();

Best
right now if i switch to the blue and back to the red, the modifications i made on the red are gone.
Go to Top of Page

xequte

38127 Posts

Posted - May 20 2020 :  20:32:57  Show Profile  Reply
In that case, maybe you should have some TIEBitmap fields that store the state of each channel, and then you can assign the "original" channel or the edited one.

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

pierrotsc

USA
497 Posts

Posted - May 20 2020 :  20:43:50  Show Profile  Reply
Nigel, have you looked my demo? I think that other was I am doing. I guess I have to update the buffer image every time I make a modification of there is no way to tell the image has been changed or does the onimagechange is triggered?
Go to Top of Page

xequte

38127 Posts

Posted - May 20 2020 :  22:03:34  Show Profile  Reply
Hi

Yes, I have your demo open in front of me. It is just my demo with a TImageEnMView added, so I don't really understand what it is trying to do.

The OnImageChangeEx occurs whenever the image changes, so can you not use that?



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

pierrotsc

USA
497 Posts

Posted - May 21 2020 :  09:49:01  Show Profile  Reply
looks like i cannot. program crashes when it starts. i guess the event is called before the commands inside have been initialized. i'll try to find another event to update each channels when image processes have occured.
thanks
Go to Top of Page

xequte

38127 Posts

Posted - May 21 2020 :  16:08:27  Show Profile  Reply
Why not just check whether the channels have been initialized or not? (they are not nil, or use a field for your current state: Uninitialized, EditingChannelR, etc.)

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

pierrotsc

USA
497 Posts

Posted - May 21 2020 :  16:34:05  Show Profile  Reply
not sure if i understand. the image is loaded into a temprary buffer that has 4 layers. the rgb, r,g and b. the layerview is mapped to the imageenview buffer. when i select a layer, i assigned the corresponding of one of the 4 layers to my main imageenview. i do all the processes on my main imageenview. it is not linked at all to the buffer image. i need to do the way back. that means re assign the current imageenview back to the correct of the 4 layers in the buffer. i do not do any processing on the imdividual channel.
Go to Top of Page

xequte

38127 Posts

Posted - May 21 2020 :  16:54:06  Show Profile  Reply
Hi

Can you forward me your latest demo and tell me in what way it is not working?

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

pierrotsc

USA
497 Posts

Posted - May 21 2020 :  17:41:09  Show Profile  Reply
i can modify the demo to look more my program and upload it. will do that tomorrow
best
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - May 31 2020 :  16:57:01  Show Profile  Reply
Nigel, i have modified the demo.
Just run it, open an image
On the right you should see the blue channel displayed
Drag the trackbar to change the contrast.
Now click on the green channel and back on the blue channel.
The blue channel is back the way it was.
When i move the trackbar, i would like the RGB channel to be modified

Best

attach/pierrotsc/2020531165652_202051335024_RGBChannels.zip
8.7 KB
Go to Top of Page

xequte

38127 Posts

Posted - Jun 01 2020 :  01:28:57  Show Profile  Reply
Hi

Contrast is a visual property (i.e. does not modify the image, just changes the way it is shown). To actually change the image, you need to apply the contrast, with ImageEnView1.IEBitmap.FixContrast.

Of course, if you do that you will constantly be applying more contrast (applying contrast to an image that has already contrast applied), so you should store an original image or channel image and apply contrast to that.

I don't really follow your demo, but this is the method to apply the contrast showing in ImageEnViewDest to the selected layer in ImageEnViewSrc:

procedure TForm1.btnApplyContrastClick(Sender: TObject);
begin
  // Apply the contrast
  ImageEnViewDest.IEBitmap.FixContrast;
  ImageEnViewDest.Update;
  ImageEnViewSrc.layers[ImageEnViewSrc.LayersCurrent].Bitmap.Assign( ImageEnViewDest.IEBitmap );
  ImageEnViewSrc.Update();
end;


Another option would be to simultaneously update the contrast of both of your views:

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  ImageEnViewDest.IEBitmap.Contrast := TrackBar1.Position;
  ImageEnViewDest.Update;

  ImageEnViewSrc.CurrentLayer.Bitmap.Contrast := TrackBar1.Position;
  ImageEnViewSrc.Update;
end;


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