Jump to content
Software FX Community

Export does not produce an image - MFC


User (Legacy)

Recommended Posts

Hi

I am trying to use

Export(CHART_BITMAP, filename) to save a file , but the file is zero bytes.

There is no window associated, I just want to set the attributes and export

the graph to a bitmap.

Can u please provide me a sample or the steps to get this working.

Here are the steps I followed

m_pChartFX.CreateInstance(__uuidof(ChartFX));

m_pChartFX->ClearData(CD_STRINGS);

//in general to remove different settings per series in the other charts

m_pChartFX->ClearData(CD_PERSERIESATTRIBUTES);

//in general to remove tools like dataeditor, legend boxes set in other

charts

m_pChartFX->ClearData(CD_TOOLS);

//to remove the stripes set in the scatter chart

m_pChartFX->ClearData(CD_STRIPES);

//set Orientation to LANDSCAPE

m_pChartFX->Printer->Orientation = ORIENTATION_LANDSCAPE; //LANDSCAPE;

ICfxAxisPtr pAxis;

pAxis = m_pChartFX->Axis->Item[AXIS_X];

pAxis->AdjustScale();

m_pChartFX->MultipleColors = TRUE;

m_pChartFX->Gallery = (CfxGallery)BAR;

m_pChartFX->Chart3D = FALSE;

m_pChartFX->OpenDataEx((CfxCod) (COD_VALUES|COD_REMOVE), 1, 10);

for (int i=0; i < (iRows-1); i++)

{

m_pChartFX->ValueEx[0][i] = 10.00;

m_pChartFX->Legend[i] = "Text";

}

m_pChartFX->CloseData(COD_VALUES);

m_pChartFX->LegendBox = FALSE;

m_pChartFX->Axis->Item[AXIS_X]->LabelAngle = 90;

m_pChartFX->Refresh();

m_pChartFX->EXPORT(CHART_BITMAP,filename);

Thanks

Indhu

Link to comment
Share on other sites

Thanks

I am using the OCX. but I could not find a property to set the size. Can you

tell what property that is

Thanks

Indhu

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:vmqs7Eh6BHA.1484@webserver1.softwarefx.com...

> The chart needs to have a size in order to be exported.

>

> If you are using the DLL, a window HAS to be created even if it is

> invisible.

>

> If you are using the OCX, then you don't need to create a window but you

do

> need to assign a size to the control.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

In an OCX, the Size is a property that the container provides not the

control itself.

The CreateControl function in MFC will assign this size for you but it will

also Activate it hence creating a window.

To assign a size without creating a window, you can use

IOleObject::SetExtent

See documentation on IOleObject for details.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...