// It's best to do this on Windows 10
Set Window On
Set Display Mode 1280, 720, 32, 0 // Remember that THIS is the Rendering Resolution
Set Window Size 1280, 720 // This will stretch whatever the Display Mode is
Set Window Position 100, 100
Sync Rate 60
Disable EscapeKey
AutoCam Off
Set Camera Aspect (1280 / (720 * 1.0)) // We can use this to Support Non-Square Pixels
// Otherwise DBP can get a bit "twitchy" with Rendering
// To further cover what I mean from above, we can actually improve performance by commenting out Set Display Mode
// this will default to 640x480... then we manually set the Window to 720p as above
// The output is 720p but the Rendering Resolution remains 4:3 480p :)
// Wish we could do that in AppGameKit
ObjectCube = 1
Make Object Cube ObjectCube, 10.0
Position Object ObjectCube, 0.0, 0.0, 50.0
Rotation# = 0.0
Repeat
Inc Rotation#, 2.0
Rotate Object ObjectCube, Rotation#, 0.0, Rotation# * 0.5
// Point Function
Pixel2 = Point( X, Y )
// BackBuffer Version of Point( X, Y )
Lock BackBuffer
pBackBuffer = Get BackBuffer Ptr() + 12
BufferWidth = Get BackBuffer Width()
BufferHeight = Get BackBuffer Height()
BufferPitch = Get BackBuffer Pitch() // This is Width * ( Depth / 8 )
X = MouseX( ) : Y = MouseY( )
Inc pBackBuffer,( Y * BufferPitch + ( X * 4 ) )
Pixel = *pBackBuffer
Unlock BackBuffer
Text 10, 10, "Red: " + Str$( RGBR( Pixel ) ) + " Green: " + Str$( RGBG( Pixel ) ) + " Blue: " + Str$( RGBB( Pixel ) )
Text 10, 20, "Red: " + Str$( RGBR( Pixel2 ) ) + " Green: " + Str$( RGBG( Pixel2 ) ) + " Blue: " + Str$( RGBB( Pixel2 ) )
// Now as a Note I'd recommend using the BackBuffer Approach as it tends to be more accurate (updates properly on all Windows Versions)
// and with FastSync won't cause Rendering "Glitches" on Windows 7, 8 or 10
FastSync
Until EscapeKey()
That works just fine... well as find as DBP does on Windows 10 anyway.
I'd look over your code more closely to see what you're doing weirdly, but my friend is bugging me to play Fortnite.
Still I have a feeling the issue is with what you're trying to do.
Point( ) mind will always Default to the Currently Active Bitmap (if it's On-Screen or Off-Screen)... and do that, you can get the Bitmap Pointer; but the Pitch won't be available to automatically get... so I did add a comment to show how to calculate it (Safely)
Basically each Pixel is a 4 Byte Alignment, but as 32-bit is the Highest Format DBP supports; this should really only ever be 4 Bytes