FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

Lock and unlock pixels


You must lock the pixels before you CopyBits or do anything that might move memory around before you're done updating but you can unlock them when you are not accessing them. Yes, the addresses will change and yes, it can cause a crash if you don't keep them locked down and hang on to an address assuming that the next time you need to reference it it will be in the same place.

Charlie Dickman


If you are addressing a GWORLD then you'll need to LOCKPIXELS.

If it's the screen that you're writing to (as in my original posting of FN SetCPixel), you don't lock it. But beware of a variety of disasters that can befall you: the user may move the window, change the screen pixel depth, change monitor size...

Robert Purves