Missing attributes?

A place to report problems and bugs in SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
putty tat
Posts: 8
Joined: Mon May 08, 2017 2:34 pm

Missing attributes?

#1

Post by putty tat »

Creating and learning to create scripts. I can set Exposure and gain and can see the changes on the screen.
However, Brightness, Gamma and Contrast works neither on camera controls nor on display settings.
These work manually. I'm assuming SharpCap works on both 32 and 64 Bit systems. Any ideas please

putty tat
User avatar
admin
Site Admin
Posts: 13296
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Missing attributes?

#2

Post by admin »

Can you share your script and also what camera you are using.

thanks,

Robin
putty tat
Posts: 8
Joined: Mon May 08, 2017 2:34 pm

Re: Missing attributes?

#3

Post by putty tat »

SharpCap is latest version
Camera ia ASI120MC-S
My system is Win 7 Prop 64 Bit

My Script

SharpCap.SelectedCamera.GetControl(CommonPropertyIDs.Exposure).Value = 0.3


SharpCap.SelectedCamera.GetControl(CommonPropertyIDs.Gain).Value = 1

SharpCap.SelectedCamera.GetControl(CommonPropertyIDs.Brightness).Value = 5

#import enough to run the above samples in a custom script
import clr ; clr.AddReference("SharpCap.Base") ; from SharpCap.Base.PropertyControls import CommonPropertyIDs;
User avatar
admin
Site Admin
Posts: 13296
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Missing attributes?

#4

Post by admin »

Ah, there is no CommonPropertyId for brightness (really because brightness isn't a control all cameras agree on, so if you are planning on adjusting it you are already dealing with camera specific information).

You need to find the property by name, like this

Code: Select all

print SharpCap.SelectedCamera.Controls.Find(lambda x:x.Name == "Brightness").Value
cheers,

Robin
Post Reply