|
-
Jun 22nd, 2000, 01:23 AM
#1
Thread Starter
Hyperactive Member
I have a propriatary database that contains images. I have a third party OCX that will extract the image and display it on a form. The OCX however contains no functionality for exporting the image to a file.
I want to capture the image being displayed so I can export it myself using other means. The problem is that the application will be running on a server that will be locked. In other words the image being displayed will be covered by the administrators lock screen on the server.
So the question is... How can I capture the image on a form that isn't currently being displayed? I've tried bitblt which works just fine up until the screen is locked and then I just get the section of the lock screen covering the underlying image. Anyway, need some assistance from a guru. Thanks.
-
Jun 22nd, 2000, 02:12 AM
#2
_______
..maybe...
'not sure if this will help but it's worth a look
'capture the form image to bmp file
'
'>>>>>>>>> bas module code <<<<<<<<<<<
Public Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub CaptureScreen(ByVal sFileName As String)
'To get the Entire Screen
'Call keybd_event(vbKeySnapshot, 1, 0, 0)
'To get the Active Window
Call keybd_event(vbKeySnapshot, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), sFileName
End Sub
'
'>>>>>> Form Code <<<<<<
Private Sub Command1_Click()
Call CaptureScreen("c:\My Documents\Form.bmp")
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 22nd, 2000, 02:31 AM
#3
Thread Starter
Hyperactive Member
I think you capture code is actually going to work but for some reason both examples you gave me capture the entire screen. Could you look at it again and see how I would only capture the current form.
If this does end up working you will be a pagan god. Thanks for your help.
-
Jun 22nd, 2000, 04:44 AM
#4
_______
sorry
sorry about that..I thought I tested all code before I
stored it in my db...I must have missed one..
the option to set the different parameters doesn't seem
to work..all I get is a copy of the code and not even
the actual running image.
I'll see if I can find another version but it may be a
little..going on holidays tomorrow and the boss has
decided I should do a weeks work on my last day...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 22nd, 2000, 05:51 AM
#5
_______
...tried tested and true..
ok..this code will capture your form and save it to a bmp
if you use a titleless form and an image container
with stretch set to true and sizez to fill the form then
you should end up with the image you load into the
image container...
good luck...
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Function getIt(ByVal theFile As String) As Boolean
Dim lString As String
On Error GoTo Trap
'Check if the File Exist
If Dir(theFile) <> "" Then Exit Function
Call keybd_event(vbKeySnapshot, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), theFile
getIt = True
Exit Function
Trap:
'Error handling
MsgBox "Error Occured in fSaveGuiToFile. Error #: " & Err.Number & ", " & Err.Description
End Function
Private Sub Command1_Click()
Call getIt("c:\my documents\its.bmp")
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|