Author |
Topic |
xequte
38127 Posts |
|
pierrotsc
USA
497 Posts |
Posted - May 19 2020 : 17:31:03
|
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 |
|
|
pierrotsc
USA
497 Posts |
Posted - May 20 2020 : 20:03:09
|
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. |
|
|
xequte
38127 Posts |
Posted - May 20 2020 : 20:32:57
|
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
|
|
|
pierrotsc
USA
497 Posts |
Posted - May 20 2020 : 20:43:50
|
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? |
|
|
xequte
38127 Posts |
Posted - May 20 2020 : 22:03:34
|
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
|
|
|
pierrotsc
USA
497 Posts |
Posted - May 21 2020 : 09:49:01
|
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 |
|
|
xequte
38127 Posts |
Posted - May 21 2020 : 16:08:27
|
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
|
|
|
pierrotsc
USA
497 Posts |
Posted - May 21 2020 : 16:34:05
|
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. |
|
|
xequte
38127 Posts |
Posted - May 21 2020 : 16:54:06
|
Hi
Can you forward me your latest demo and tell me in what way it is not working?
Nigel Xequte Software www.imageen.com
|
|
|
pierrotsc
USA
497 Posts |
Posted - May 21 2020 : 17:41:09
|
i can modify the demo to look more my program and upload it. will do that tomorrow best |
|
|
pierrotsc
USA
497 Posts |
Posted - May 31 2020 : 16:57:01
|
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 |
|
|
xequte
38127 Posts |
Posted - Jun 01 2020 : 01:28:57
|
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
|
|
|
Topic |
|