Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another magnification routine (UPDATED)
#6
(04-19-2024, 05:12 PM)TerryRitchie Wrote: I corrected a bug in the code. See the original post above.

I like the program.
You could extend the main loop by manually increasing it
For example like this.

Code: (Select All)
 '+--------------------+
'| Begin main program |
'+--------------------+

Do '                                                begin main program loop
    If _KeyHit = 43 Then
        Size = Size + 0.5
        SetupMagnify 200, 200, 10, Size, 0, 0, 0, 0 
        Magnify Image 
    End If
    If _KeyHit = 45 Then
        Size = Size - 0.5
        If Size < 1 Then Size = 1
        SetupMagnify 200, 200, 10, Size, 0, 0, 0, 0 
    Magnify Image 
    End If

    _Limit 30 '                                      30 frames per second
    _PutImage , Image, 0 '                          clear the screen with image to magnify
    While _MouseInput: Wend '                        get latest mouse update
    MagnifiedImage = GetMagImage(_MouseX, _MouseY) ' get the magnified image at current mouse pointer
    _PutImage (MagX, MagY), MagnifiedImage '        display magnified image on screen
    _Display '                                      update screen with changes
Loop Until _KeyDown(27) '                            leave when ESC key pressed
_FreeImage Image '                                  remove image to magnify from RAM
_FreeImage MagnifiedImage '                          remove magnified image from RAM
System '                                            return to the operating system

'+------------------+
'| End main program |
'+------------------+
Reply


Messages In This Thread
RE: Another magnification routine (UPDATED) - by Steffan-68 - 04-19-2024, 06:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Updating my Mouse/Keyboard/Buttons/Fields routine. Pete 36 5,516 04-03-2025, 11:26 PM
Last Post: Pete
  Oh when will this drunken binge end? Another graphics routine. Pete 3 959 03-31-2024, 08:29 AM
Last Post: Pete
  Multiple key press player movement routine. Pete 1 747 10-02-2022, 10:44 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)