Results 1 to 8 of 8

Thread: Dll-Test

  1. #1
    Member
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    406
    Rep Power
    56

    Dll-Test

    Hi,

    I wrote a Dll with Oxygen and wanted to know whether it runs also with thinbasic.
    I am satisfied ! Thank you Charles and Eros !

    Don't press the close button of this window!
    It won't close this application, instead take the escape key.

    Peter
    Uses "UI","DRAWS"
    Declare Function GetDC     Lib "user32.dll" Alias "GetDC"     (ByVal hwnd As Long) As Long
    Declare Function GetKey    Lib "user32.dll" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
    Declare Function TextOut   Lib "gdi32.dll"  Alias "TextOutA"  (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
    Declare Function TextColor Lib "gdi32.dll"  Alias "SetTextColor"(ByVal hdc As Long, ByVal crColor As Long) As Long
    Declare Function SetBkMode Lib "gdi32.dll"  Alias "SetBkMode" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
    
    Declare Function DrawCircle  Lib "Draws.dll" Alias "DrawCircle"  (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal r As Long, ByVal Color As Long) 
    Declare Function DrawBox     Lib "Draws.dll" Alias "DrawBox"     (ByVal hdc As Long, ByVal x1 As Long,ByVal y1 As Long,ByVal x2 As Long,ByVal y2 As Long,ByVal Color As Long) 
    Declare Function DrawEllipse Lib "Draws.dll" Alias "DrawEllipse" (ByVal hdc As Long, ByVal mx As Long,ByVal my As Long,ByVal r1 As Long,ByVal r2 As Long,ByVal Color As Long)
    Declare Function DrawLine    Lib "Draws.dll" Alias "DrawLine"    (ByVal hdc As Long, ByVal x2 As Long,ByVal y2 As Long,ByVal x3 As Long,ByVal y3 As Long,ByVal Color As Long)
    
    
    Dim hwnd,hdc,jx As Long
    Dim Isay As String
    Isay = "PRESS ESCAPE KEY!"
     
    hwnd = Canvas_Window("Dll_Test",0,0,800,600) 
    hdc  = GetDC(hwnd)
    TextColor hdc,&H006400
    SetBkMode hdc,1                  
    
    DrawCircle hdc,50, 50,40,&HB00000
    DrawCircle hdc,738,50,40,&HC00000
    DrawBox    hdc,10, 10,768,780,255*34825
    DrawLine   hdc,10,580,776,580,255*34825
    For jx=0 To 49
    DrawEllipse hdc,250,300,200+jx,150-jx,&H80FF80*jx
    DrawEllipse hdc,620,300,150-jx,200+jx,&HFF80FF*jx
    Next
    
    While GetKey(27) =0
    TextOut hdc,322,32,Isay,Len(Isay)
    Wend
    
    Attached Files Attached Files
    Last edited by peter; 12-01-2011 at 10:39.

  2. #2
    very beautiful figures, it resembles the Möbius strip en.wikipedia.org/wiki/Möbius_strip
    i think that it may be possible to use blit to make the draw sustained on the form, i forgot how to do that. some discussions are here:
    http://www.thinbasic.com/community/s...highlight=blit

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,138
    Rep Power
    733
    Hi Peter,

    my NOD32 antivirus gives me virus warning on the download. It is probably false positive because Charles does some cutting edge optimizations again, but I thought I will let you know.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    Member
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    406
    Rep Power
    56
    Hi Petr,

    That could be interesting for Charles!

    thanks.

  5. #5
    Every time I make a change to the top end of the code some antiVirus systems protest! - usually it is only 2 out of the 43 listed in VirusTotal. If you get any false positives then please submit them to your antivirus provider. I will try to do the same but some providers appear to restrict submission to users only.

    Many Thanks

    Charles

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,138
    Rep Power
    733
    Will do
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,869
    Rep Power
    404
    When I copy and paste the code it loses the crlf. How did you guys get around it?
    The rar file just had the dll file and no script in my download.

  8. #8
    Member
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    406
    Rep Power
    56
    Hi k9,

    there isn't more in the RAR file other than a DLL!

    lol

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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