GdViewer brightness and contrast not working correctly

Discussions about document viewing.
Post Reply
pankaj5k
Posts: 9
Joined: Fri Dec 28, 2012 4:40 pm

GdViewer brightness and contrast not working correctly

Post by pankaj5k » Mon Mar 11, 2013 11:09 am

Hi,

I am using the ActiveX version of GdViewer in an ASP.Net website and am able to show documents in it by using this code

Code: Select all

 ImageID = m_GdPictureImaging.CreateGdPictureImageFromFile(path);
 var oGdViewer = document.getElementById("GdViewer1");
 oGdViewer.DisplayFromGdPictureImage(ImageID);
I have also provided controls to adjust the brightness and contrast of the tiff file. There are controls to increase and decrease the brightness but that just doesnt work correctly.

the code i use is

Code: Select all

 var result = m_GdPictureImaging.SetBrightness(ImageID, currentBrightness);
var result = oGdViewer.Redraw();
to increase the brightness i add 10 to the current values and to decrease i subtract 10. The viewer also updates the view but
let say

The document has loaded. starting value is 0

increase brightness by 10 : no visible effect (brightness : 10 )
increase brightness by 10 : no visible effect(brightness : 20)
decrease brightness by 10 : no visible effect(brightness : 10)
decrease brightness by 10 : no visible effect(brightness : 0)
decrease brightness by 10 : gets a little dark(brightness : -10)
decrease brightness by 10 : get more darker(brightness : -20)
increase brightness by 10 : gets more darker(brightness : -10 )
increase brightness by 10 : no visible effect(brightness : 0)

then i have to increase 3 times more to get back to the original brightness. i i push brightness all the way to -100 then no matter how many times i increase it it stays black only.

I am trapping the gdstatus for each action and sometimes(rarely) i get a Out of Memory status and other wise it is 0 and no action is performed.

Please can you help as to why this problem is occuring and why does an activex control goes out of memory?

Please help as this is urgent and needs to be fixed soon

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: GdViewer brightness and contrast not working correctly

Post by SamiKharma » Mon Mar 11, 2013 3:53 pm

Hi,

This behavior is absolutely correct.
Please do have a look at this thread to understand more how brightness is calculated:
post13625.html?hilit=brightness#p13625

As to the OutOfMemory question, I cannot really provide any help, as I need further information. A simple sample code would also help.

Best regards,
Sami

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests