Opaqueness of subwindows
ChrLie
I have a graph on which a region is highlighted using a drawn rectangle, and I added a subwindow to enlarge a certain region of the plot.
When right-clicking on the subwindow -> colors -> both backgrounds, I selected pure white and checked "opaque". The (modified) graph recreation marco is:
Window Graph0() : Graph
// make data
make/N=10/O yy = p
PauseUpdate; Silent 1 // building window...
Display /W=(667,377,1369,914) yy
ModifyGraph mode=3, marker=19, useMrkStrokeRGB=1
ModifyGraph tick=2, mirror=1, minor=1, btLen=4, stLen=2
SetAxis/A/N=1 left
SetAxis/A/N=1 bottom
SetDrawLayer UserBack
SetDrawEnv xcoord= prel,ycoord= left,linethick= 0,fillfgc= (49151,53155,65535)
DrawRect 0,1.8,1,2.2
SetDrawLayer UserFront
Display/W=(0.531,0.543,0.896,0.886)/HOST=# yy
ModifyGraph mode=3, marker=19, useMrkStrokeRGB=1
ModifyGraph tick=2, mirror=1, minor=1, btLen=4, stLen=2
SetAxis/N=1 left 2,4
SetAxis/N=1 bottom 2,4
RenameWindow #,G0
SetActiveSubwindow ##
EndMacro
// make data
make/N=10/O yy = p
PauseUpdate; Silent 1 // building window...
Display /W=(667,377,1369,914) yy
ModifyGraph mode=3, marker=19, useMrkStrokeRGB=1
ModifyGraph tick=2, mirror=1, minor=1, btLen=4, stLen=2
SetAxis/A/N=1 left
SetAxis/A/N=1 bottom
SetDrawLayer UserBack
SetDrawEnv xcoord= prel,ycoord= left,linethick= 0,fillfgc= (49151,53155,65535)
DrawRect 0,1.8,1,2.2
SetDrawLayer UserFront
Display/W=(0.531,0.543,0.896,0.886)/HOST=# yy
ModifyGraph mode=3, marker=19, useMrkStrokeRGB=1
ModifyGraph tick=2, mirror=1, minor=1, btLen=4, stLen=2
SetAxis/N=1 left 2,4
SetAxis/N=1 bottom 2,4
RenameWindow #,G0
SetActiveSubwindow ##
EndMacro
Note that the background of the subwindow is transparent. When I activate the subwindow and execute:
ModifyGraph wbRGB=(65535,65535,65534),gbRGB=(65535,65535,65534)
it becomes opaque (this is what I want) but
ModifyGraph wbRGB=(65535,65535,65535),gbRGB=(65535,65535,65535)
makes it transparent again. Is that expected or a possibly a bug?
(IP 9.06B01, MacOS 12)
I don't know and I didn't find anything in the manual, but I was assuming this is a hack for ye old days where alpha was not a thing yet.
November 29, 2024 at 07:08 am - Permalink
chozo is correct- pure white in that situation means transparent. He is also correct that this is a holdover from the days before transparency in computer colors. The method for making a transparent background was to avoid erasing the background before drawing. Naturally, colored semi-transparent backgrounds weren't possible!
Your command that sets the background to (65535,65535,65534) is actually the recommended way to get an opaque white background. Since only the most significant 8 bits of that 16-bit number are used for the color, you will get pure white but opaque that way.
To put this in historical perspective, I recently removed some code from Igor that handled 16-color monitors. That's not 16-bit, truly 16 total colors!
December 2, 2024 at 03:50 pm - Permalink
Thanks both for the explanation!
It's just somewhat irritating that the menu seem to give you the option for opaqueness and pure white, but then it remains transparent. Nonetheless, the workaround is perfectly fine!
December 9, 2024 at 12:21 am - Permalink