Page 1 of 1

Import Graphics Files

Posted: Tue Jul 02, 2013 12:43 am
by 6926758
Is it possible to import a graphics file and display the file using TeeChart? By a graphics file I do not mean a tee file. I am using MFC and MDI. I envision a template which opens files and displays the file in class derived from CView, with code something like this:

Code: Select all

CFileDialog dlg( OPEN, _T("emf wmf jpg png bmp gif"), _T("*.emf; *.wmf; *.jpg; *.png; *.bmp; *.gif"),
				OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_ENABLESIZING | OFN_EXPLORER,
				_T("Graphics Files|*.emf; *.wmf; *.jpg; *.png; *.bmp; *.gif|"));

if (dlg.DoModal() != IDOK || dlg.GetPathName().GetLength() == 0)   // Ensure the length of the filename is valid.
{
	return;
}

CString csFile = dlg.GetPathName();

m_Chart1.GetImport().LoadFromFile(csFile);

Re: Import Graphics Files

Posted: Tue Jul 02, 2013 12:57 pm
by yeray
Hi,

And what would you expect TeeChart to draw when the image is loaded?
If you want to show the image in the background, you could load it in the panel or in the back wall. Something like this:
flower.png
flower.png (299.99 KiB) Viewed 8012 times
If you want to load the image in a series, you may want to do something like in the image below. We did this example with TeeChart Java for Android:
bahfbfga.png
bahfbfga.png (355.34 KiB) Viewed 8007 times

Re: Import Graphics Files

Posted: Tue Jul 02, 2013 3:27 pm
by 6926758
Display the image and print the image. I will look into putting it on the back wall or panel.