Page 1 of 1

XIMAGE : Gamma Level Adjustment

Posted: Mon Jul 08, 2024 2:41 pm
by nageswaragunupudi
Upcoming Enhancement to TXImage class:

New Data nGamma. Default value 1.0
Programmer can assign any value 0.0 or greater to change the Gamma value.

Image

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oImage, oFont, cFile
   local oGamma, nGamma  := 100.0, oSay

   cFile := "..\bitmaps\olga1.jpg"

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 600,800 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
      TITLE Upper( cFileName( cFile ) )

   @ 60,20 XIMAGE oImage FILE cfile SIZE -20,-20 OF oDlg
   oImage:FitRect()

   @ 10,20 SAY "Gamma" SIZE 100,20 PIXEL OF oDlg

   @ 10,120 SLIDER oGamma VAR nGamma SIZE oDlg:nWidth - 260,20 PIXEL OF oDlg ;
      HORIZONTAL RANGE 0,300 UPDATE TOP DIRECTION ;
      ON CHANGE ( oImage:nGamma :=  nVar * 0.01, oDlg:Update() ) ;
      ON THUMBPOS ( nGamma := nVar, oImage:nGamma := nVar * 0.01, oDlg:Update() ) ;
      SLIMSTYLE

   @ 10,oDlg:nWidth - 120 SAY oSay PROMPT { || oImage:nGamma } PICTURE "9.9999" SIZE 100,20 PIXEL OF oDlg RIGHT UPDATE

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

Re: XIMAGE : Gamma Level Adjustment

Posted: Mon Jul 08, 2024 2:54 pm
by cmsoft
Excelente trabajo Mr. Rao!!
Muchas gracias!

Re: XIMAGE : Gamma Level Adjustment

Posted: Mon Jul 08, 2024 4:59 pm
by Antonio Linares
Dear Rao, excellent work as usual.

thank you very much!

Re: XIMAGE : Gamma Level Adjustment

Posted: Tue Jul 09, 2024 12:10 am
by Armando
Mr. Rao:

Excellent work, congratulations

Regards

Re: XIMAGE : Gamma Level Adjustment & More : Updated

Posted: Fri Jul 12, 2024 1:40 pm
by nageswaragunupudi
Varying
Gamma, Brightness, Contrast, AlphaLevel, Blurr and Toggling Gray

Image

Re: XIMAGE : Gamma Level Adjustment

Posted: Fri Jul 12, 2024 3:27 pm
by Antonio Linares
Great work!

Many thanks

Re: XIMAGE : Gamma Level Adjustment

Posted: Sat Jul 13, 2024 1:10 am
by RAMESHBABU
Dear Nageswara Rao gaaru,

Thank you for your additions to xImage Class for Image Editing.

It is a great help to me to completely avoid using FreeImage.dll wrapper
function for Image editing.

The following is my Image editing dialog which is almost similar to your
functionality.

Image

Thank you once again.

- Ramesh Babu P