Results 1 to 4 of 4

Thread: Direct2D

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    441

    Direct2D

    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
    Last edited by LeandroA; Apr 19th, 2021 at 11:36 AM.
    leandroascierto.com Visual Basic 6 projects

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width