Click to See Complete Forum and Search --> : Dropping Images to a Picture Control


simi
January 21st, 2000, 06:54 PM
Does anyone know how to be able to drop an image from the clipboard onto an image control?

I would like to be able to allow someone to do press "print scrn" and have the image in the clipboard like usual, but then have a control on the form where they could Past it by either "shift Insert" (or Ctrl X or what the other option is) or by some other method to paste the clipboard image to the control.

Does anyone know if this is easily available?

Thank you very much

David Stephen

Eric Gravert
January 21st, 2000, 08:46 PM
Piece of cake


private Sub Form_KeyPress(KeyAscii as Integer)

If KeyAscii = 22 then 'Ctrl+V was pressed
If Clipboard.GetFormat(vbCFBitmap) then 'Make sure a bitmap is in the clipboard
Image1.Picture = Clipboard.GetData(vbCFDIB) 'Load the picture on to the image control
End If
End If

End Sub

private Sub Form_Load()
me.KeyPreview = true 'allow the form to view all key press events
Image1.Stretch = true 'I want the iamge to size into the image control
End Sub