user2950872
user2950872

Reputation: 95

ColorBlend not found

#include <gdiplus.h>
using namespace Gdiplus;
#pragma comment (lib,"Gdiplus.lib")

then draw some text:

GdiplusStartupInput gdiplusStartupInput;
        ULONG_PTR           gdiplusToken;
        GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
        HDC hdc;
        Font *fn = new Font(TEXT("Arial"),50);
        hdc=GetDC(hWnd);
        ColorBlend cb = new ColorBlend();
        LinearGradientBrush *linGrBrush=new LinearGradientBrush(
            Point(0, 10),
            Point(200, 10),
            Color(255, 255, 0, 0),   
            Color(255, 0, 0, 255));

        Graphics *graphics=new Graphics(hdc);
         PointF drawPoint = PointF(150.0F,150.0F);
         SolidBrush* myBrush = new SolidBrush(Color::Black);
        graphics->DrawString(L"Test text",strlen("Test text"),fn,drawPoint,linGrBrush);
        GdiplusShutdown(gdiplusToken);

And had error that ColorBlend not found identifier,but seem all right. How I can fix it?

Upvotes: 1

Views: 267

Answers (2)

xMRi
xMRi

Reputation: 15355

I think the corresponding function in GDI+ is LinearGradientBrush::SetInterpolationColors As far as I understand the .NET documentation the InterpolationColors member in GDI+ is used here with this function.

Upvotes: 1

melak47
melak47

Reputation: 4850

The ColorBlend class is part of the .Net Framework, as far as I can tell there is nothing by that name in GDI+ for C++.

Upvotes: 1

Related Questions