Your code works fine under win32/win64/Qt, on the other hand to make it work under GTK2, you have to comment out the following line://Bitmap.PixelFormat := pf32bit;