Viewer color

Moderators: TomKerekes, dynomotion

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Viewer color

Post by Tarasevih » Tue Jun 07, 2022 4:48 pm

Hi Tom.
Can I somehow change the background color of the viewer?
I want to make it black instead of green.

Regards,
Taras.
Attachments
Viewer.png
Viewer.png (10.88 KiB) Viewed 1215 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Viewer color

Post by TomKerekes » Tue Jun 07, 2022 7:19 pm

Hi Taras,

Only if you edit the source code and recompile KMotionCNC.
Regards,

Tom Kerekes
Dynomotion, Inc.

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Tue Jun 07, 2022 8:26 pm

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.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Viewer color

Post by TomKerekes » Wed Jun 08, 2022 1:47 am

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
Regards,

Tom Kerekes
Dynomotion, Inc.

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Wed Jun 08, 2022 8:57 pm

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.
Attachments
Viewer new.png

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Wed Jun 08, 2022 9:02 pm

I mean yellow, green, white, orange and blue colors showing the current state of the axes.

Thank you.
Attachments
Axis.png
Axis.png (29.41 KiB) Viewed 1190 times

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Viewer color

Post by TomKerekes » Wed Jun 08, 2022 9:17 pm

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);
}
Regards,

Tom Kerekes
Dynomotion, Inc.

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Thu Jun 09, 2022 5:30 am

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.

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Thu Jun 09, 2022 5:50 am

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.

Tarasevih
Posts: 101
Joined: Fri Jul 09, 2021 11:26 am

Re: Viewer color

Post by Tarasevih » Wed Jun 15, 2022 7:57 pm

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.

Post Reply