Topic: Script for Clipboard bitmap operations

I am very new to MVD.  For a DBImage control, I would like to paste a bitmap from the clipboard instead of using the file dialog.  I am not able, however, to reference the ClipBrd Unit.

The following generates an error:
uses Clipbrd;

Is this possible with MVD scripting?

Re: Script for Clipboard bitmap operations

Hello tbo and welcome on the forum,


The error you get while trying to reference is normal, even if sad : at the moment, you can not do that with the actual version of MVD.


Is for the actual ClipBrd unit, it is only partially integrated and support only strings (as far as I known).


You can use

someStringVar := ClipboardGet;

to assign the text content of the clipboard to a variable or

ClipboardSet(someStringVar); 

to put some text in the clipboard, but that is pretty much all I achived.



if Clipboard.HasFormat(X) then...

X beeing bitmap, metafile or picture is not implemented yet.


What you can do though, is
- CTRL-C to copy your image
- open the file dialog
- CTRL-V which will paste the path to your image in the file dialog


This will put the image in your DBImage without having to browse to it.


Hope this helps a little


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Script for Clipboard bitmap operations

You can't just paste a bitmap from clipboard, because database also should store file name of this bitmap.

Dmitry.