Page 1 of 3
Viewer color
Posted: Tue Jun 07, 2022 4:48 pm
by Tarasevih
Hi Tom.
Can I somehow change the background color of the viewer?
I want to make it black instead of green.
Regards,
Taras.
Re: Viewer color
Posted: Tue Jun 07, 2022 7:19 pm
by TomKerekes
Hi Taras,
Only if you edit the source code and recompile KMotionCNC.
Re: Viewer color
Posted: Tue Jun 07, 2022 8:26 pm
by Tarasevih
I'm ready to try. It is in this library - BuildAllLibs.sln ?
Tell me where please.
visual studio 2015 already and installed and include MFC option.
Regards,
Taras.
Re: Viewer color
Posted: Wed Jun 08, 2022 1:47 am
by TomKerekes
No KMotionCNC is an Application Example that uses the Libraries. Open BuildExamples.sln.
See Also.
You would change this:
Code: Select all
// Colors
m_ClearColorRed = 0.0f;
m_ClearColorGreen = 0.2f;
m_ClearColorBlue = 0.0f;
in openglCTL.cpp
HTH
Re: Viewer color
Posted: Wed Jun 08, 2022 8:57 pm
by Tarasevih
Hi Tom.
Thank you Tom! I got it all.
I would like to know where you can change the colors of the current position of the axes?
Regards,
Taras.
Re: Viewer color
Posted: Wed Jun 08, 2022 9:02 pm
by Tarasevih
I mean yellow, green, white, orange and blue colors showing the current state of the axes.
Thank you.
Re: Viewer color
Posted: Wed Jun 08, 2022 9:17 pm
by TomKerekes
See
Code: Select all
void CKMotionCNCDlg::SetBigValueColor(CDisplay *Disp,int axis, bool KMotionPresent, bool DisplayedEnc)
{
if (m_Simulate)
Disp->SetTextColor(0xFFFFFF);
else if (KMotionPresent && (MainStatus.Enables & (1<<CS_axis[axis])) && CS_axis[axis] >= 0)
{
if (m_ShowMach)
Disp->SetTextColor(0x0080FF);
else
if (DisplayedEnc)
Disp->SetTextColor(0xFFC000);
else
Disp->SetTextColor(0x00FF00);
}
else
Disp->SetTextColor(0x00FFFF);
}
Re: Viewer color
Posted: Thu Jun 09, 2022 5:30 am
by Tarasevih
Hi Tom.
Thank you Tom! I got it all.
I'm sorry for distracting you.I could not find where the yellow color of the axes is set.
Regards,
Taras.
Re: Viewer color
Posted: Thu Jun 09, 2022 5:50 am
by Tarasevih
I'm sorry , I figured it out
Disp->SetTextColor(0x00FFFF);
It's just that this code - 00FFFF is the color of the sea wave.
Thank you Tom!
Regards,
Taras.
Re: Viewer color
Posted: Wed Jun 15, 2022 7:57 pm
by Tarasevih
Hi Tom.
Is it possible to change the background bitmap of the main window depending on the color of the current position of the axes?
That is, for example, when the axes are not initialized, the background will be one when the second one is initialized.
How to access the main window background bitmap from code?
Regards,
Taras.