Sign in Join

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

Mailing lists / lazarus / 2012-05

Paintbox.Canvas copyrect problem

4 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

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

Leonardo M. Ramé

Hi, I'm implementing a Copy to clipboard function to an application. It has to copy the contents of a TPaintBox's Canvas into the Clipboard, but found a bug, it copies the windows over the Paintbox too.

I've attached a screenshot showing a popup over the TPaintbox that's also copied with the paintbox's canvas.

Regards,

Leonardo M. Ram? http://leonardorame.blogspot.com -------------- next part -------------- A non-text attachment was scrubbed... Name: clopboard.JPG Type: image/jpeg Size: 22460 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120507/9670fb82/attachment-0001.jpe>

Reply by email

Leonardo M. Ramé
to Leonardo M. Ramé
Leonardo M. Ram? wrote 7 lines
Hi, I'm implementing a Copy to clipboard function to an application. It has to copy the contents of a TPaintBox's Canvas into the Clipboard, but found a bug, it copies the windows over the Paintbox too. I've attached a screenshot showing a popup over the TPaintbox that's also copied with the paintbox's canvas.

I must add this problem only happens on Windows. I've also tested it using Linux and Wine and it works ok.

Reply by email

Leonardo M. Ramé
to Leonardo M. Ramé
Leonardo M. Ram? wrote 11 lines
On 2012-05-07 16:59:06 -0300, Leonardo M. Ram? wrote: > Hi, I'm implementing a Copy to clipboard function to an application. It > has to copy the contents of a TPaintBox's Canvas into the Clipboard, but > found a bug, it copies the windows over the Paintbox too. > > I've attached a screenshot showing a popup over the TPaintbox that's > also copied with the paintbox's canvas. > I must add this problem only happens on Windows. I've also tested it using Linux and Wine and it works ok.

I've attached a sample project, containing a TPaintBox with an OnPaint event which just paints it in red color, then, I placed a TButton in the middle of the paintbox.

The onClick event of the button copies the contents of the PaintBox to the clipboard. But, as you can see, it also copies the button.

As the button is not part of the clipboard (it is over it, not part of it), it shouldn't be copied.

Regards,

Leonardo M. Ram? http://leonardorame.blogspot.com -------------- next part -------------- A non-text attachment was scrubbed... Name: test.tar.gz Type: application/x-tar-gz Size: 1767 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120507/c96ab788/attachment.bin>

Reply by email

Leonardo M. Ramé
to Leonardo M. Ramé
Leonardo M. Ram? wrote 23 lines
On 2012-05-07 17:12:46 -0300, Leonardo M. Ram? wrote: > On 2012-05-07 16:59:06 -0300, Leonardo M. Ram? wrote: > > Hi, I'm implementing a Copy to clipboard function to an application. It > > has to copy the contents of a TPaintBox's Canvas into the Clipboard, but > > found a bug, it copies the windows over the Paintbox too. > > > > I've attached a screenshot showing a popup over the TPaintbox that's > > also copied with the paintbox's canvas. > > > I must add this problem only happens on Windows. I've also tested it > using Linux and Wine and it works ok. > I've attached a sample project, containing a TPaintBox with an OnPaint event which just paints it in red color, then, I placed a TButton in the middle of the paintbox. The onClick event of the button copies the contents of the PaintBox to the clipboard. But, as you can see, it also copies the button. As the button is not part of the clipboard (it is over it, not part of it), it shouldn't be copied.

I've registrerd this in Mantis:

http://mantis.freepascal.org/view.php?id=21981

Reply by email