Exemplo n.º 1
0
int __cdecl wmain()
{
    // Ignoring the return value because we want to continue running even in the
    // unlikely event that HeapSetInformation fails.
    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    if (SUCCEEDED(CoInitialize(NULL)))
    {
		PlotData data1(200);
		for(size_t i = 0; i < 200; ++i)
		{
			data1[i * 2] = i / 200.0f;
			data1[i * 2 + 1] = pow(i, 1.6f) / 8.0f;
		}

		PlotData data2(200);
		for(size_t i = 0; i < 200; ++i)
		{
			data2[i * 2] = i / 200.0f;
			data2[i * 2 + 1] = i;
			//data2[100 + i * 2] = 1;
			//data2[101 + i * 2] = 1;
		}

		PlotData data3(200);
		for(size_t i = 0; i < 200; ++i)
		{
			data3[i * 2] = i / 200.0f;
			data3[i * 2 + 1] = i * 2;
		}

		PlotData data4(200);
		for(size_t i = 0; i < 200; ++i)
		{
			data4[i * 2 ] = i / 200.0f; 
			data4[i * 2 + 1] = 0.125f * pow(i, 1.3f);
		}

		PlotData *data[] = { &data1, &data2, &data3, &data4, 0 };
        HRESULT hr = SaveToImageFile(data, 800, 600, 1.0f, 600.0f, 50.0f, 40.0f, 0.1f, 100.0f);
        if (FAILED(hr))
        {
            wprintf(L"Unexpected error: 0x%x", hr);
        }

        CoUninitialize();
    }

    return 0;
}
int __cdecl wmain()
{
    // Ignoring the return value because we want to continue running even in the
    // unlikely event that HeapSetInformation fails.
    HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

    if (SUCCEEDED(CoInitialize(NULL)))
    {
        HRESULT hr = SaveToImageFile();
        if (FAILED(hr))
        {
            wprintf(L"Unexpected error: 0x%x", hr);
        }

        CoUninitialize();
    }

    return 0;
}