我有一个错误
错误 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/