Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hardware Acceleration and Uses
#10
For a quick demo of what I'm talking about, see here:

Code: (Select All)
Dim buttons(1) 'just two simple buttons for the demo
button(0) = MakeButton("Hello World")
button(1) = MakeButton("STEVE!")

x = 100 'just for moveable button
Cls , 4 'a red screen for a background
Do
_PutImage (x, 100), button(0)
_PutImage (200, 200), button(1)
k = _KeyHit
Select Case k 'left/right arrow to move that button
Case 19200: x = x - 3: If x < 0 Then x = 0
Case 19712: x = x + 3: If x > _Width * _FontWidth - 100 Then x = _Width * _FontWidth - 100
Case Is > 0: System 'any other key to end
End Select
_Display
_Limit 30
Loop

Function MakeButton (caption$)
d = _Dest
temp = _NewImage(_FontWidth * Len(caption$) + 4, _FontHeight + 4, 32)
_Dest temp
Color &HFFFFFFFF&&, 0 ' bright white text with no background
Cls , &HFF0000FF&& 'dark blue background for this button
Line (0, 0)-(_Width - 1, _Height - 1), &HFFFFFFFF, B 'white trim around the edges
Line (1, 1)-(_Width - 2, _Height - 2), &HFFFFFFFF, B '2 pixel trim
_PrintString (3, 3), caption$ 'print the caption
MakeButton = _CopyImage(temp, 33) 'make the hardware button
_Dest d 'restore the destination
_FreeImage temp 'free the temp image
End Function
Reply


Messages In This Thread
Hardware Acceleration and Uses - by Pete - 02-18-2025, 04:57 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-18-2025, 05:42 PM
RE: Hardware Acceleration and Uses - by a740g - 02-18-2025, 05:47 PM
RE: Hardware Acceleration and Uses - by Pete - 02-18-2025, 10:35 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-18-2025, 11:23 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-18-2025, 11:36 PM
RE: Hardware Acceleration and Uses - by Pete - 02-18-2025, 11:45 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 06:06 AM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 06:42 AM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 06:58 AM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 07:06 AM
RE: Hardware Acceleration and Uses - by Pete - 02-19-2025, 12:05 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 02:28 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 02:16 PM
RE: Hardware Acceleration and Uses - by Pete - 02-19-2025, 06:00 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-19-2025, 07:54 PM
RE: Hardware Acceleration and Uses - by Pete - 02-19-2025, 08:52 PM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-20-2025, 04:23 PM
RE: Hardware Acceleration and Uses - by Pete - 02-21-2025, 02:28 AM
RE: Hardware Acceleration and Uses - by SMcNeill - 02-21-2025, 03:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Half baked pipe dream questions - hardware and os Parkland 9 1,332 05-23-2025, 03:00 PM
Last Post: madscijr
  Fun with hardware acceleration. Pete 0 464 10-20-2022, 10:25 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)