XIMAGE : Gamma Level Adjustment

Post Reply
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

XIMAGE : Gamma Level Adjustment

Post 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
Regards

G. N. Rao.
Hyderabad, India
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: XIMAGE : Gamma Level Adjustment

Post by cmsoft »

Excelente trabajo Mr. Rao!!
Muchas gracias!
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XIMAGE : Gamma Level Adjustment

Post by Antonio Linares »

Dear Rao, excellent work as usual.

thank you very much!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Armando
Posts: 3249
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Contact:

Re: XIMAGE : Gamma Level Adjustment

Post by Armando »

Mr. Rao:

Excellent work, congratulations

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: XIMAGE : Gamma Level Adjustment & More : Updated

Post by nageswaragunupudi »

Varying
Gamma, Brightness, Contrast, AlphaLevel, Blurr and Toggling Gray

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: XIMAGE : Gamma Level Adjustment

Post by Antonio Linares »

Great work!

Many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RAMESHBABU
Posts: 626
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: XIMAGE : Gamma Level Adjustment

Post 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
Post Reply