Skip to content

Commit

Permalink
Merge pull request #137 from royqh1979/text
Browse files Browse the repository at this point in the history
修正:未设置gdi+ graphics对象的文字反锯齿属性
  • Loading branch information
wysaid authored Oct 19, 2023
2 parents 392594b + 45ea069 commit 95f034a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Gdiplus::Graphics* IMAGE::getGraphics() {
m_graphics=new Gdiplus::Graphics(m_hDC);
m_graphics->SetPixelOffsetMode(Gdiplus::PixelOffsetModeHalf);
m_graphics->SetSmoothingMode(m_aa? Gdiplus::SmoothingModeAntiAlias : Gdiplus::SmoothingModeNone);
m_graphics->SetTextRenderingHint(m_aa? Gdiplus::TextRenderingHintAntiAlias: Gdiplus::TextRenderingHintSystemDefault);
}
return m_graphics;
}
Expand Down Expand Up @@ -246,6 +247,7 @@ void IMAGE::enable_anti_alias(bool enable){
#ifdef EGE_GDIPLUS
if (NULL != m_graphics) {
m_graphics->SetSmoothingMode(m_aa? Gdiplus::SmoothingModeAntiAlias : Gdiplus::SmoothingModeNone);
m_graphics->SetTextRenderingHint(m_aa? Gdiplus::TextRenderingHintAntiAlias : Gdiplus::TextRenderingHintSystemDefault );
}
#endif
}
Expand Down

0 comments on commit 95f034a

Please sign in to comment.