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
 run Colorize after picking a color from a colordialog.

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
More-Majorum Posted - Jul 30 2022 : 06:03:17
Hello,

I would like to run "ImageEnView.Proc.Colorize" after picking a color from a colordialog.
The problem is that I don't know how to convert the color chosen in the colordialog.


The code below obviously does not work :)

procedure TForm1.Button1Click(Sender: TObject);
Var
  H, S, L : double;
begin
  if colordialog1.execute then
  begin
    ColorToHSL(colordialog1.Color, H, S, L);
    ImageEnView.Proc.Colorize(H, S, L);
  end;
end;


Thank you in advance for your help.
9   L A T E S T    R E P L I E S    (Newest First)
More-Majorum Posted - Jul 31 2022 : 03:16:49
It works !
Thanks again for the quick help ;
More-Majorum Posted - Jul 31 2022 : 02:58:34
Thank you very much for all these examples.
I will try as soon as possible.
xequte Posted - Jul 31 2022 : 02:49:21
The above method should work:




Nigel
Xequte Software
www.imageen.com
More-Majorum Posted - Jul 31 2022 : 02:45:24
I have several frames (which I provide in white) in my application.



I would like the user to be able to change the color of these frames through a colordialog.

attach/More-Majorum/202273124515_16-9-H.png
xequte Posted - Jul 31 2022 : 02:33:56
Is this what you are looking for?

  // Colorize the image based on the user's selection of a color
  if IEPromptForColor( cl ) then
  begin
    ColorToHSV( cl, h, s, v );
    ImageEnView1.Proc.Colorize( h, s, 1.0 );
  end;



// User selected Red...




Nigel
Xequte Software
www.imageen.com
xequte Posted - Jul 31 2022 : 02:18:08
Hi

What is it that you are looking for Colorize to do?

Colorize is the same as setting the HSV value for each pixel with your specified hue and saturation, and the value based on the gray-scale conversion of each pixel multiplied by your luminosity value.
[code]

// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );



// Colorize the image with a sepia look
ImageEnView1.Proc.Colorize( 40, 50, 1.1 );



Nigel
Xequte Software
www.imageen.com
More-Majorum Posted - Jul 31 2022 : 01:37:00
Overall, Imageen online help is excellent (with lots of examples), which saves me from asking noob questions on the forum.

Unfortunately, regarding Proc.Colorize and ColorToHSL there is no example on how to get the values to pass in Colorize.
More-Majorum Posted - Jul 31 2022 : 01:07:53
Hello,

An example with red from the colordialog:
When converted with ColorToHSL :

procedure TForm1.Button1Click(Sender: TObject);
Var
  H, S, L : double;
begin
  if colordialog1.execute then
  begin
    ColorToHSL(colordialog1.Color, H, S, L);
    ImageEnView1.Proc.Colorize(round(H), round(S), L);
    Caption := 'H :  ' + floattostr(H) + '    S :  ' + floattostr(S)  + '    L :  ' + floattostr(L);
  end;
end;




When converted with ColorToHSL, I get the values H=0, S=1, L=0.5.
ImageEnView1.Proc.Colorize(0, 1, 0.5);

I get a gray image :)
xequte Posted - Jul 31 2022 : 00:18:41
Hi

In what way doesn't it work?

(ColorToHSL() is in the hyieutils unit).

Nigel
Xequte Software
www.imageen.com