我加载的图像是一张透明底PNG图像,背景使用渐变的绿色画刷
#include <windows.h>
#include <d2d1.h>
#include <d2d1helper.h>
#include <dwrite.h>
#pragma comment(lib, "dwrite.lib")
#pragma comment(lib, "d2d1.lib")
#include <wincodec.h>
HINSTANCE g_hinst;
HWND g_hwnd;
ID2D1Factory * g_factory;
ID2D1HwndRenderTarget * g_render_target;
ID2D1SolidColorBrush * g_brush;
IDWriteFactory * g_write_factory;
IDWriteTextFormat * g_text_format;
ID2D1GradientStopCollection * g_gradient_stop_collection;
ID2D1LinearGradientBrush * g_linear_gradient_brush;
ID2D1RadialGradientBrush * g_radial_gradient_brush;
IWICImagingFactory * g_image_factory = NULL;
ID2D1Bitmap * g_bitmap = NULL;
bool AppInit()
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
D2D1CreateFactory(