Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Maximum width of canvas = 1348921, but why?

  1. #11
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    Quote Originally Posted by EmbeddedMan View Post
    TB has no way to allocate or use memory outside of this limit, correct?
    Correct.

    Only way is to develop a thinBasic 64bit but actually is impossible because the compiler I use for development, PowerBasic, is only 32bit and there are no plan to release a 64bit version.
    I'm considering to abandon PowerBasic for something else but will be a looooong way
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  2. #12
    Quote Originally Posted by ErosOlmi View Post
    Correct.

    Only way is to develop a thinBasic 64bit but actually is impossible because the compiler I use for development, PowerBasic, is only 32bit and there are no plan to release a 64bit version.
    I'm considering to abandon PowerBasic for something else but will be a looooong way
    OK, that is very good to know. No worries at all - I'm certain I can rework my application to get much longer recording times while still staying within the 2GB limit.

    *Brian

  3. #13
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    An example like the one attached can be useful?
    Is a small program showing a continuously moving display of curves without storing any data.

    I've made few changes in UI module to allow such scrolling so before to be able to release I need to release a new thinBasic version.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	16 
Size:	10.2 KB 
ID:	9814
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  4. #14
    Quote Originally Posted by ErosOlmi View Post
    An example like the one attached can be useful?
    Is a small program showing a continuously moving display of curves without storing any data.

    I've made few changes in UI module to allow such scrolling so before to be able to release I need to release a new thinBasic version.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	16 
Size:	10.2 KB 
ID:	9814
    Very cool! That would be a very useful mode for my application - infinite recording ability (streaming data to disk .csv file) but you only get 1 'screenful' of graph to see.

    Is your app using a canvas? (yes, obviously, since you named it canvas.)

    What changes did you to to enable this functionality?

    *Brian
    Last edited by EmbeddedMan; 08-02-2018 at 19:47.

  5. #15
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    Hi Brian,

    I'm still not ready to release a new thinBasic version because I'm in the middle of a big change. So here how to create the above example just replacing UI module.

    I've added "Canvas_GetSize(Width, Height)" in UI module. The rest is something that was already there in UI module.
    Attached thinBasic_UI.dll. Please copy it into \thinBasic\Lib\ directory replacing your current one. Please have at least thinBasic 1.10.4 installed: http://www.thinbasic.com/community/s...inBasic-1-10-x

    Here Canvas_Continuous example
    ' Here is a small program showing a continuously moving display of curves.
    ' This may be useful for monitoring any real time data.
    
    Uses "UI"
    
    begin ControlID
      %IDC_GRAPHIC1
      %IDC_BUTTON1_EXIT
      %IDC_BUTTON1_STRT
      %IDC_BUTTON1_STOP
      %IDC_TIMER1
    end ControlID
    
    CallBack Function ShowDIALOG1Proc()
    
        Static TimerInterval As Long
        Static WidthVar, HeightVar, Xstep As Long
        Static StationaryXpos, yPosRed, yPosBlue, yPosGreen As Single
        Static prevYposRed, prevYposBlue, prevYposGreen As Single
        Static xRightSpace As Long
        Static hWndSaveFocus As Dword
    
        Select Case CBMsg
            Case %WM_INITDIALOG
                ' Initialization handler
                TimerInterval = 30 ' in microseconds - can be changed
                Canvas_GetSize WidthVar, HeightVar
    
                Xstep = 2 ' number of pixels moving to the left per time inteval
                Canvas_Width Xstep
    
                xRightSpace = 10 ' blank space on right side of curves in pixels - can be changed
                StationaryXpos = WidthVar - xRightSpace
    
                Randomize Timer
                yPosRed = Rnd(2, HeightVar - 2)
                yPosBlue = Rnd(2, HeightVar - 2)
                yPosGreen = Rnd(2, HeightVar - 2)
                prevYposRed = yPosRed
                prevYposBlue = yPosBlue
                prevYposGreen = yPosGreen
    
                CONTROL ENABLE  CBHndl, %IDC_BUTTON1_STRT
                CONTROL DISABLE CBHndl, %IDC_BUTTON1_STOP
    
            Case %WM_NCACTIVATE
                If IsFalse CBwParam Then
                    ' Save control focus
                    hWndSaveFocus = win_GetFocus
                ElseIf hWndSaveFocus Then
                    ' Restore control focus
                    win_SetFocus(hWndSaveFocus)
                    hWndSaveFocus = 0
                End If
    
            Case %WM_COMMAND
                ' Process control notifications
                Select Case CBCtl
                    Case %IDC_BUTTON1_EXIT
                        If CBCtlMsg = %BN_CLICKED Then
                          Dialog End CBHndl
                        end If
    
                    Case %IDC_BUTTON1_STRT
                        If CBCtlMsg = %BN_CLICKED Then
                            CONTROL DISABLE CBHndl, %IDC_BUTTON1_STRT
                            CONTROL ENABLE  CBHndl, %IDC_BUTTON1_STOP
                            
                            DIALOG SET TIMER CBHndl, %IDC_TIMER1, TimerInterval
                            Randomize Timer
                        End If
    
                    Case %IDC_BUTTON1_STOP
                        If CBCtlMsg = %BN_CLICKED Then
                            CONTROL DISABLE CBHndl, %IDC_BUTTON1_STOP
                            CONTROL ENABLE  CBHndl, %IDC_BUTTON1_STRT
                            DIALOG KILL TIMER CBHndl, %IDC_TIMER1
                        end If
    
                End Select
                
            Case %WM_TIMER
                Select Case CBwParam
                    Case %IDC_TIMER1
                        '---Kill the timer until we have finished drawing
                        '---Keeps drawing time as low as possible
                        DIALOG KILL TIMER CBHndl, %IDC_TIMER1
    
                        Canvas_BitmapCopy3 CBHndl, %IDC_GRAPHIC1, Xstep + 1, 1, WidthVar - xRightSpace, HeightVar,1, 1
                        Canvas_Line( (WidthVar - xRightSpace, 1), (WidthVar - xRightSpace, HeightVar), %White) ' erase previous points
    
                        yPosRed = yPosRed + Rnd(2,8) * Sgn(Rnd(-yPosRed+2, HeightVar-2-yPosRed)) + 3         ' You can exchange these
                        yPosBlue = yPosBlue + Rnd(2,8) * Sgn(Rnd(-yPosBlue+2, HeightVar-2-yPosBlue))         ' random functions with
                        yPosGreen = yPosGreen + Rnd(2,8) * Sgn(Rnd(-yPosGreen+2, HeightVar-2-yPosGreen)) - 3 ' any real time measurements
    
                        Canvas_Line ( (StationaryXpos - Xstep, prevYposRed), (StationaryXpos, yPosRed), %Red)
                        Canvas_Line ( (StationaryXpos - Xstep, prevYposBlue), (StationaryXpos, yPosBlue), %Blue)
                        Canvas_Line ( (StationaryXpos - Xstep, prevYposGreen), (StationaryXpos, yPosGreen), %RGB_GREEN)
    
                        prevYposRed = yPosRed
                        prevYposBlue = yPosBlue
                        prevYposGreen = yPosGreen
    
                        '---Restore timer after drawing
                        DIALOG SET TIMER CBHndl, %IDC_TIMER1, TimerInterval
                        
                End Select
        End Select
    End Function
    
    Function TBMain()
        Local hDlg  As Dword
    
        Dialog New Pixels, %HWND_DESKTOP, "Continuously Moving Curve Display",
                            -1, -1, 543, 382, 
                            %WS_POPUP | %WS_BORDER | %WS_DLGFRAME |
                            %WS_CAPTION | %WS_SYSMENU | %WS_MINIMIZEBOX | %WS_CLIPSIBLINGS |
                            %WS_VISIBLE | %DS_MODALFRAME  To hDlg
                            
        Control Add Canvas, hDlg, %IDC_GRAPHIC1, "", 8, 8, 528, 336', %WS_CHILD Or %WS_VISIBLE
        canvas_Attach hDlg, %IDC_GRAPHIC1
        Canvas_Color -1, %White
        Canvas_Clear
        
        Control Add Button,  hDlg, %IDC_BUTTON1_EXIT, "E&xit", 456, 352, 80, 24
        Control Add Button,  hDlg, %IDC_BUTTON1_STRT, "&Start", 8, 352, 112, 24
        Control Add Button,  hDlg, %IDC_BUTTON1_STOP, "St&op", 128, 352, 112, 24
    
        Dialog Show Modal hDlg, Call ShowDIALOG1Proc
    
    End Function
    
    Attached Files Attached Files
    Last edited by ErosOlmi; 09-02-2018 at 08:21.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  6. #16
    Thanks Eros for this canvas exciting feature and the educative example, it is suitable for a huge number of situations such as monitoring earthquakes data , vibrations before volcanoes eruptions, and heart pulses.

  7. #17
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    eheh

    Really happy how from a simple request can come out many ideas.
    That's what I think passionate all of us.

    I have some more interesting examples on Canvas but I will publish next week because I will have a working week-end at the company.
    We have an BIIIG important go-live in march and we are a bit late on schedule.
    Last edited by ErosOlmi; 09-02-2018 at 10:52.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  8. #18
    Hi Eros, regarding the experimental thinBasic_UI.dll
    when we try the example C:\thinBasic\SampleScripts\UI\RichEdit\RichEdit_001.tbasic it outputs an error
    line number 130
    line code: "CONTROL ADD RTF_GETCLASS, HDLG, %ID_RICHEDIT,....%WS_EX_CLIENTEDGE
    token found: %WS_EX_CLIENTEDGE
    when we comment %WS_EX_CLIENTEDGE and open a sample.rtf file it is not displayed
    i post this report for your attention but i know the above thinBasic_UI.dll is not official and for testing the Big Canvas only in TB 1.10.4.0

  9. #19
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    Thanks a lot.
    I will have a look.

    I would like to release a new complete thinBasic version 1.10.5 but quite busy at work.
    I hope to be able to release by this week-end

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  10. #20
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    51
    Posts
    8,313
    Blog Entries
    2
    Rep Power
    10
    Ciao Primo,

    here it is working fine under Windows 10
    What OS are your using? RichEdit is a complex control loaded from different DLL depending on the OS version.
    Click image for larger version. 

Name:	Capture.PNG 
Views:	16 
Size:	26.1 KB 
ID:	9825
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Canvas Fun
    By peter in forum Sources, Templates, Code Snippets, Tips and Tricks, Do you know ...
    Replies: 1
    Last Post: 18-11-2013, 16:04
  2. ListView control -> columns fixed width???
    By Oscar Ugolini in forum thinBasic General
    Replies: 5
    Last Post: 15-06-2012, 08:23
  3. Replies: 6
    Last Post: 16-06-2010, 06:40
  4. canvas example :)
    By lydia_sp in forum UI (User Interface)
    Replies: 1
    Last Post: 16-09-2009, 17:19
  5. DIALOG maximum size
    By martin in forum thinBasic General
    Replies: 5
    Last Post: 25-05-2009, 12:26

Posting Permissions

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