Hi All,
I'm brand-new to SharpCap, using it with my Celestron NexImage 10 both on NexStar and on a microscope.
I intended to somehow enhance the Display Histogram Stretch control (don't quite like the way the middle line (gamma) is moved when moving the left or right line).
So I tried to dig into Scripting to see which properties are defined and can be controlled, but in contrast to what Help states I do not get any automatic properties list when typing the '.' so I simply can't find out which properties of the SharpCap objects exist.
- Do I miss anything obvious?
- Is there a documentation available listing all objects and properties (a scripting reference manual)?
- Is it possible to control the three lines (black, white, gamma), i.e. get and set their position, of the Display Histogram Stretch control?
If so, a sample code snippet would be much appreciated.
My goal basically is to always have the middle line in the center of the left and right line when moving either of these, and of doing some repositioning with buttons instead of dragging with the mouse.
Cheers -
Peter
Object properties not showing
- admin
- Site Admin
- Posts: 13344
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Object properties not showing
Hi Peter,
the auto-suggestions really should work - they do for me in the latest 3.1 - for instance
The list appears as soon as I type the '.' after the Exposure. Note that it only works in the top panel in the script console and it only works if the thing to the left of the '.' is a valid object (ie not 'None').
You can adjust the level stretch with code like
however some values seem to work and others are rejected when making changes this way - looks like a bug in the latest 3.1. I will investigate.
cheers,
Robin
the auto-suggestions really should work - they do for me in the latest 3.1 - for instance
The list appears as soon as I type the '.' after the Exposure. Note that it only works in the top panel in the script console and it only works if the thing to the left of the '.' is a valid object (ie not 'None').
You can adjust the level stretch with code like
Code: Select all
SharpCap.SelectedCamera.Controls.FindByName("Display Black Point").Value = 0.1
SharpCap.SelectedCamera.Controls.FindByName("Display MidTone Point").Value = 0.4
SharpCap.SelectedCamera.Controls.FindByName("Display White Point").Value = 0.9
cheers,
Robin
Re: Object properties not showing
Ah - in the top panel - I of course assumed that this happens in the coding panel like in other development systems - this is where you need this support in the first place.
Thanks for the hint!
Thanks for the hint!
- admin
- Site Admin
- Posts: 13344
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Object properties not showing
Hi,
it's because Python is a dynamically typed language - telling what properties/methods an object has is hard unless you have an object available and you can ask it. Therefore it works in the immediate panel, but can't work in the editor panel.
cheers,
Robin
it's because Python is a dynamically typed language - telling what properties/methods an object has is hard unless you have an object available and you can ask it. Therefore it works in the immediate panel, but can't work in the editor panel.
cheers,
Robin
Re: Object properties not showing
Ah - understood.
So now I klicked through the object hierarchy (at least the entities which seemed fitting) but could not find how to address the Display Histogram Stretch control. Any hints?
Cheers -
Peter
So now I klicked through the object hierarchy (at least the entities which seemed fitting) but could not find how to address the Display Histogram Stretch control. Any hints?
Cheers -
Peter
- admin
- Site Admin
- Posts: 13344
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Object properties not showing
Hi, it's the code at the bottom of my first reply. There are actually three separate controls for the black white and mid points.
BTW I uploaded a new version that fixes the problem with some values not be accepted via scripting.
Btw2 I am assuming you are trying to adjust the level stretch in the right control panel, not the live stack one.
Robin
BTW I uploaded a new version that fixes the problem with some values not be accepted via scripting.
Btw2 I am assuming you are trying to adjust the level stretch in the right control panel, not the live stack one.
Robin