Hello I have two questions regarding Direct2D, the answers are probably a resounding no but I must ask.
it is possible to draw something and preserve the background as we do with GDI, for example if in the form I have an image and I want to draw a text with Direct2 in some part of the form, without the background being a fixed color and without having to repaint the image.
the other, is it possible to paint only a part and not the whole form?
I know it is different from GDI but maybe someone understands what my intention is.
Code:Private Sub Form_Paint() Dim sText As String 'font "Segoe UI Emoji" Const D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT = 4 sText = ChrW2(&H2638) & "Hello World!" & ChrW2(&H2639) cTarget.BeginDraw cTarget.Clear D2D1.ColorF(Ivory) cTarget.DrawText sText, Len(sText), ByVal cTextFormat, D2D1.RectF(20, 20, 220, 120), cBrush, D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT cTarget.EndDraw ByVal 0&, ByVal 0& End Sub




Reply With Quote