c++ - 错误 :Unresolved external Symbol of d2d1effects. h DIRECTX 中的 CLSID_D2D1HueRotation 属性

标签 c++ c directx directx-11 unresolved-external

我有一个错误 错误 LNK2001:无法解析的外部符号 _CLSID_D2D1HueRotation 我不明白为什么会出现此错误。 错误出现在代码 CLSID_D2D1HueRotation 的第 4 行。 这是代码...

float width = 350;
    float height = 100;
    Microsoft::WRL::ComPtr<ID2D1Effect> hueRotationEffect;

    context2->CreateEffect(CLSID_D2D1HueRotation, &hueRotationEffect);

    hueRotationEffect->SetInput(0, tetronimoBitmap.Get());
    hueRotationEffect->SetValue(D2D1_HUEROTATION_PROP_ANGLE, 270.0f);

    rectImage = { width,height, width + tetronimoBitmap->GetSize().width, height + tetronimoBitmap->GetSize().height };
    //context2->CreateBitmapBrush(tetronimoBitmap.Get(), tetronimoBitmapBrush.ReleaseAndGetAddressOf());

    context2->DrawImage(hueRotationEffect.Get());

    //context2->FillRectangle(rectImage, tetronimoBitmapBrush.Get());
    //context2->DrawBitmap(tetronimoBitmap.Get(), &rectImage, 1.0f, D2D1_INTERPOLATION_MODE_LINEAR, NULL);
    if (FAILED(context2->EndDraw())) {
        context2->EndDraw();
    }

最佳答案

解决方法是链接d2d1.lib, dxguid.lib。感谢 kiran Biradar。

关于c++ - 错误 :Unresolved external Symbol of d2d1effects. h DIRECTX 中的 CLSID_D2D1HueRotation 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58010372/

相关文章:

c++ - 在opencv中对图像进行 mask

c++ - 管道+选择: select never woken up

c - 如何将多个小数百分比与 printf 对齐

java - java中移位运算的实现

c# - 防止屏幕捕获软件捕获应用程序屏幕

c++ - VS2015 : Variadic template specialization

c++ - Xcode 5 C++ SDL 应用程序未在 XCode IDE 外部加载

C 扩展 : <? 和 >?运营商

c++ - 在 directx 11 中显示 2 个三角形

c++ - DX11 Sprite 问题