* * *

Author Topic: BGRA Draw behaves different on Windows vs GTK (Linux)  (Read 1051 times)


  • Newbie
  • Posts: 1
BGRA Draw behaves different on Windows vs GTK (Linux)
« on: February 16, 2013, 08:05:01 pm »

Have some problem with drawing a BGRABitmap using the Draw to the canvas to display a bitmap on a Paintbox components canvas.

On windows it uses the Paintbox canvas top left corner as reference but on Linux it uses the parent canvas or client area as top left corner. E.g. adding a TPanel as parent to the paintbox solved the problem for me but still the behaviour is different from Linux GTK to Windows regarding the drawing on the Canvas (using canvas functions like Line etc. works with top left corner of the Paintbox canvas as reference).

I'm using Lazarus 32 bit 1.0.6 both on Windows (64 bit Windows 7 Pro) and Linux (Ubuntu 32 bit 12.10).

Eirik Nesje


  • Hero Member
  • *****
  • Posts: 1989
    • Personal webpage
Re: BGRA Draw behaves different on Windows vs GTK (Linux)
« Reply #1 on: February 16, 2013, 11:17:35 pm »
Maybe try to modify BGRAGtkBitmap unit.

gdk_pixbuf_render_to_drawable and gdk_draw_rgb_32_image are used to draw using gdk. Offsets are read from TGtkDeviceContext(ACanvas.Handle) variable.
Conscience is the debugger of the mind



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus