[Customdrawn] Some patches

Giuliano Colla giuliano.colla at fastwebnet.it
Tue Apr 3 11:17:41 CEST 2012


Il 03/04/2012 10:40, Felipe Monteiro de Carvalho ha scritto:
> On Tue, Apr 3, 2012 at 10:29 AM, Giuliano Colla
> <giuliano.colla at fastwebnet.it>  wrote:
>> I've verified that with XGetImage on the root window you really get the
>> image of your screen, and not only the desktop background:
>>
>> http://www.copeca.it/colla/snap1.jpg
> Great! =)
>
>> If you give me some hints (e.g. which backend supports screen capture, where
>> it's implemented, and how the main program uses that feature. IOW which are
>> the source files to look at), I can try and do the same for X11, just to see
>> what happens.
> I am already starting to forget what was already implemented and where
> ... because this thing has just grown huge =)
>
Sometimes I think that virtual abstract things have been conceived to 
make life harder.
They would be great if you wanted to change widgetset on the fly (which 
isn't very usual...), but if you're trying to follow the path of 
anything starting from LCL, you're stuck at a virtual abstract 
declaration, and either you remember how it's been implemented, or you 
must single step in debug! You save a few ifdefs, and you loose hours 
trying to reconstruct what you've done!
> But the Cocoa backend supports screenshot taking.
>
>  From the LCL side the screenshot is TBitmap.LoadFromDevice which will
> call customdrawnlclintfh.inc this routine:
>
> function RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC; const
> ARect: TRect): Boolean; override;
>
> Each backend needs to implement this routine so implement it in
> customdrawnlclintf_x11.inc
>
> See how Cocoa does it:
>
> function TCDWidgetSet.RawImage_FromDevice(out ARawImage: TRawImage;
> ADC: HDC; const ARect: TRect): Boolean;
> var
.....
I think that X11 will look pretty much the same.
Thanks,

Giuliano






More information about the Customdrawn mailing list