Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-05

Write to root window?

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jon Foster

I imagine its possible but I haven't a clue to know even where to beg in looking. Is it possible to write to the root window in X (i386 Linux)? I'd like to manipulate some images and write them there.

THX - Jon

Jon Foster JF Possibilities, Inc. 541-410-2760 Making computers work for you!

Reply by email

Vannus
to Jon Foster
Jon Foster wrote 6 lines
I imagine its possible but I haven't a clue to know even where to beg in looking. Is it possible to write to the root window in X (i386 Linux)? I'd like to manipulate some images and write them there. THX - Jon

i think i came across something in the past probably for KDE3.5. might me desktop specific.

looking at kde/gnome/freedesktop API might be helpfull

- V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100525/9a8638f9/attachment.html>

Reply by email

Graeme Geldenhuys
to Jon Foster: I imagine its possible but I haven't a clue to know even where to beg in looking. Is it…
Jon Foster wrote
I imagine its possible but I haven't a clue to know even where to beg in looking. Is it possible to write to the root window in X (i386 Linux)? I'd like to manipulate some images and write them there.

No idea how to do it via LCL, but here is a small sample of code I use for a fpGUI utility application which draws a rectangular outline around components/windows (of any X11 application) under the mouse pointer.

The trick is to draw to the DefaultRootWindow(display) result of whatever display you are working with.

-------------------------

procedure TMainForm.DrawOutline;
begin
  if not FOutlineDrawn then
  begin
    XSync(fpgApplication.Display, False);
    XDrawRectangle(
        fpgApplication.Display,
        DefaultRootWindow(fpgApplication.Display),
        FOutlineGC,
        newrect.Left, newrect.Top, newrect.Width, newrect.Height);
    lastrect := newrect;
    FOutlineDrawn := True;
    lblPos.Text := Format('(%d,%d)', [newrect.Left, newRect.Top]);
    lblSize.Text := Format('(%d,%d)', [newrect.Width, newRect.Height]);
    lblHandle.Text := IntToHex(last_child, 6);
  end;
end;
-------------------------
Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Jon Foster
to Marc Weustink
Marc Weustink wrote 9 lines
Jon Foster wrote: > I imagine its possible but I haven't a clue to know even where to beg in > looking. Is it possible to write to the root window in X (i386 Linux)? > I'd like to manipulate some images and write them there. I can't remember if writing is supported, but DC := GetDC(0); will give you a root device context. Marc

Thanks! I'll have to give it a shot when I get a chance.

-Jon

Jon Foster JF Possibilities, Inc. 541-410-2760 Making computers work for you!

Reply by email