Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste clipboard copied picture to overwrite existing picture.

Status
Not open for further replies.

abaldwin

Programmer
Mar 27, 2001
798
US
VB6 Crystal reports v 11 using crviewer control on a form.


In a vb application I have a report designer added to the project. The report currently is not attached to any db just trying to get one thing in particular to work.

On a vb form there is a picture box that has a picture and then during processing text is added to the picturebox using a rectagle draw method. The end result is a picturebox with the orginal equipment in the background and some data layed over it.

Crystal report has
1. Report header
2. Page header A with a logo for a picture name = picLogo
3. Text entry for title.
4. Page header B containing only a picture (original equipment) name = picEquip
5. Details section (nothing in it yet)
6. Report footer
7. Page footer.


In the vb application using the following code will copy the contents of the picture box to the clipboard

Code:
Public Sub CopyPicBox(stRecPic As PictureBox)
    'Copies the contents of the received picture box to the clip board for pasting elsewhere
    
    'Clear the clipboard
    Clipboard.Clear
    
    With stRecPic
        Clipboard.SetData stRecPic.Image
        
    End With
    
End Sub

After executing the above code one can paste the picture into word, excel, outlook etc. (Tested)

How To:

I can load the report fine (do that all the time). Any code samples available to show how to replace the picEquip with the contents of the clipboard.

Can not figure out the syntax for something like

set picequip = loadpicture(clipboard.getdata)

Have tried that and get a message of not able to find file.

Been looking for a while on the web and no Joy. Any help would be appreciated.

Thanks






Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top