| View previous topic :: View next topic |
| Author |
Message |
Bob Reeves Guest
|
Posted: Fri Apr 06, 2007 7:45 pm Post subject: TBitmap to clipboard? |
|
|
Looked at the CopyToClipboard() sample in Help but it sure looks like it
doesn't give one everything one needs to be able to actually use it. I need
to copy a simple two color bitmap to the clipboard in bitmap format.
Anyone have a working sample?
Thanks |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Apr 06, 2007 9:08 pm Post subject: Re: TBitmap to clipboard? |
|
|
"Bob Reeves" <bob (AT) somethinxtra (DOT) com> wrote in message
news:46166c0a$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Looked at the CopyToClipboard() sample in Help but it sure
looks like it doesn't give one everything one needs to be able
to actually use it.
|
CopyToClipboard() is a method of TCustomEdit. It has nothing to do
with bitmaps.
| Quote: | I need to copy a simple two color bitmap to the clipboard in bitmap
format. |
Simply Assign() the TBitmap to the global TClipboard object, ie:
#include <ClipBrd.hpp>
Clipboard()->Assign(MyBitmap);
Gambit |
|
| Back to top |
|
 |
Bob Reeves Guest
|
Posted: Fri Apr 06, 2007 10:29 pm Post subject: Re: TBitmap to clipboard? |
|
|
Thanks,
Might be because I am still using Builder 4 but TGraphic has a
SaveToClipboardFormat() Method which I was referring to but left out the
Format part. Thought this was what I was looking for but you have shown me
the way..
Thanks again
Bob |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sat Apr 07, 2007 12:30 am Post subject: Re: TBitmap to clipboard? |
|
|
"Bob Reeves" <bob (AT) somethinxtra (DOT) com> wrote in message
news:4616928e$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Might be because I am still using Builder 4 but TGraphic has
a SaveToClipboardFormat() Method which I was referring to
|
TClipboard::Assign() calls that method internally for you.
| Quote: | Thought this was what I was looking for
|
It is, sort of. SaveToClipboardFormat() prepares the bitmap data for
storage on the clipboard, but does not actually open the clipboard and
store it. You have to pass the returned handles to the Win32 API
SetClipboardData() function (which TClipboard does for you).
Gambit |
|
| Back to top |
|
 |
|