How to highlight ranges of lines in different colors in vscode extension development? - vscode-extensions

I'm trying to develop a vscode extension which would read some data from a file and based on that data, highlight ranges of lines in different colors. eg: lines 1 to 10 in red color, lines 20 to 40 in green, lines 50 to 100 in yellow. If that isn't possible I could also do the highlighting in the gutter. However, I've not been able to find anything in the vscode extension development docs that would allow me to do this. I was expecting there to be an API like vscode.editor.background(1, 10, 'red')

Related

How to stop VS 2022 Standard Edition from highlighting the code when I select search

Background
Using my newly installed VS 2022, when I search within the text of my code (say using <Ctrl>+<F3> followed by <F3>), the entire text is background-highlighted in dark-blue, forming a jagged edge of lines. The jagged edged lines are due to the fact that the lines of my code are not all of same length. This is especially contrasted against the black background (where I have no code) in "Dark" mode.
The "Blue" mode has the same effect but the contrast of background-highlighted text and background with no text, is not so pronounced.
To end this highlighting I need to escape out of the search mode.
Question
How can I stop this background highlighting of the code when I search?
What I needed to do is change the background of the search in "Find Scope Highlight"
Select the menu: Tools.(Options...).Environment.(Fonts and Color).(Find Scope Highlight) and change the [Item background] to Black

How to add two images together (green screen system) in LabVIEW

I have two images, one with subject and other one with background. The subject image has green background and I want to remove the green color from subject and add the subject without green color to another background, basically changing the background of one picture with another in LabVIEW without C code or MATLAB code, only using LabVIEW blocks.
So far, I got the following, but I am not getting one thing how to remove a very small portion of pixels. How to solve this problem,
So your algorithm is to replace a pixel, when red - blue =0 in the first place.
This condition is true for all this colors:
While there is no magenta in the picture, there is some almost black below the elbow and some almost white at the hand. So, that's replaced.
Try to restrict the colors to be replaced more, maybe like this:
Also, I'd to this independently for red and blue. So, for example
green > A AND red < B AND blue < C AND green-red > D AND green-blue > E
Since one of your files is names "final lec final.vi", I'd stop here ;-)
Oh, and just for fun: Playing with brightness and contrast reveals the JPEG artifacts, which is one part of the problem:

Coreldraw Multiple Contours in VBA

Guys I Am trying to set up a three colour text that is editable
Basically what I want is the text to be black
A 1st contour of 1mm that is white
a 2nd contour of 2mm thick which is black
I have tried the following 2 step contour
ActiveSelection.CreateContour cdrContourOutside, 2, 2, , , CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255)
this works perfectly as I want and when I edit the text the contour changes to the new text however the contours are both the same width (2mm) and not 1 & 2mm as i want
Also I cant get it to specify the correct color for each contour
If I break apart the 1st contour then add another this gives me contours of different widths and colors but I then loose the edit ability as the contour is not attached to the text
Any Ideas I Know its possible as I have seen a commercial macro that does it
Any Help appreciated
Mark
The best I can do for you is to show you the object model. I do not have CorelDraw and therefore cannot test anything.
Here is the link to the CorelDraw Object Model.
http://apps.corel.com/partners_developers/csp/resources/CorelDRAW%20VBA%20Object%20Model.pdf
And here is a link to a Programming Guide for CorelDraw.
http://apps.corel.com/partners_developers/csp/resources/dvba_pg.pdf
You can look up "Applying Effects" on page 72 of the programming guide which may help.
I would suggest also looking at creating curves from the .Shapes object and then looking at the TextRange object. the TextRange.Text property is the actual text you want to see and the TextRange.colorindex is the color of the text I believe. You will have to do some exploring, but this should help.

How to compare two line graphs using data points

I have 2 graphs as below with the blue line indicating an ideal scenario and the orange lines indicating couple of real scenarios. I wanted to check how similar the blue and orange lines are. Looking at the graph, it is obvious that the orange line in chart on top has very similar pattern as blue line. On the other hand, the orange line in bottom chart , has completely conflicting pattern. what is the best way to conclude the orange line in top chart is the better/ closest resembling pattern, mathematically.

Customized report colors "snapping" to windows default colors

I have a chart in an Access 2010 report for which I am trying to set colors of different series dynamically. The user can use checkboxes to select series to chart, with the intent being that the series on the chart will take its color from the BackColor property of the checkbox's label.
The problem is that when I run my code to create the report, the colors used are not the ones on the corresponding labels. Instead it looks like they are "snapping" to the list of colors at the following link, referred to as "standard windows colours". List of standard windows colors in RGB and Long
For example:
With myChart.SeriesCollection(1)
.Interior.Color = RGB(195, 215, 155)
End With
Sets series 1 to a dark grey color, and debug.print myChart.SeriesCollection(1).Interior.Color returns 12632256, rather than 10213315 like it should. (Long color = Red + Green*256 + Blue*65536)
I have tried opening the chart object and defining the custom colors that I want to see on the palette for the chart, and setting the appropriate colors for the series manually. This works until I try to programatically change anything, at which point, all of the colors snap to the list I linked above.
Any ideas for how to dynamically set chart colors to custom values?
Managed to answer my own question. Manually customizing the palette in MS Graph was necessary, but from there, I need to reference the colors by their index on the palette (using .Interior.ColorIndex), rather than from their RGB or Long code. The index numbers for the palette are not in any logical order, but can be found in a file accessible from this site.
It's not quite as dynamic as I had hoped for, but this is definitely good enough for what I need to do.