Thread View: comp.os.ms-windows.programmer.tools
2 messages
2 total messages
Started by Galen Raben
Fri, 08 Jan 1993 16:28
VB 2.0 - using the clipboard?
Author: Galen Raben
Date: Fri, 08 Jan 1993 16:28
Date: Fri, 08 Jan 1993 16:28
38 lines
1887 bytes
1887 bytes
Another question, this time with copying things to the clipboard with VB 2.0... On my form I have a picture control "Pic1" with a control array of image controls within "MyIcons()". Pic1 has a background bmp loaded and each image control of the MyIcons control array have individual icon loaded. The individual MyIcons controls are moved around at runtime by the program. What I am trying to do is copy the resulting graphic to the clipboard. Problem is I can't get the image controls to copy as well. Sub mnuCopy_Click Clipboard.Clear Clipboard.Setdata ActiveForm.Pic1.Picture End Sub Gets the background bitmap ok but no image control icons (note: this is an MDI child window - is why I use ActiveForm... shouldn't make a difference for purposes of what I'm asking though) I also tried Clipboard.Setdata ActiveForm.MyIcon(I%).picture (with a for/next loop) and Clipboard.Setdata ActiveControl.picture but VB says that the format is invalid in the first case and grabs the background bitmap in the second case... What Gives??? Does the clipboard object require that the image I'm trying to grab come from an object with an autorefresh property? (Image controls don't have an autorefresh property). I can't find any references in the manual or online help on copying image controls.... (just some stuff in the chapter on printing that suggests autorefresh must be true to print graphics...) Thanks again!!!!! - Galen - galenr@hpgrla.gr.hp.com
Re: VB 2.0 - using the clipboard?
Author: EE U780935
Date: Sun, 10 Jan 1993 06:10
Date: Sun, 10 Jan 1993 06:10
22 lines
1502 bytes
1502 bytes
The data you put in the Windows clipboard is only the hDC of pictures.
The MDI child in your picturebox is not owned by the picturebox.
If you want to put picturebox and the MDI icons into clipboard, get the
Desktop hWnd, then copy the area of your picture box on your screen to
clipboard....
Here are some API call needed here...
GetDesktopWindow
GetDC, ReleaseDC, CreateCompatibleDC ,.... etc (I forget)
BitBlt
The clipboard instuction in VB are not allowed here. So you must use
clipboard API function.
--
===============================================================================
Yu-Fu Wu National Tsing-Hua University
e-mail: yfwu@uz.nthu.edu.tw Dept. of Electric Engineering
Hsin-Chu City, 300
Like MS Visual Basic most! Taiwan, ROC
===============================================================================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads