Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 12.03.2007, 12:11 Titel: Remote control? |
|
|
Hallo,
ist es möglich mit FB und der Winsock.bi Remote control zu realiesieren?
bzw. Wie kann ich den Bildschirm eines sich im Netzwerk befindenden Computer bei mir in einem Fenster anzeigen lassen?
MFG Thorben |
|
Nach oben |
|
 |
The real Agent D

Anmeldungsdatum: 24.11.2005 Beiträge: 605 Wohnort: Hall i. T.
|
Verfasst am: 12.03.2007, 15:44 Titel: |
|
|
Prinzipiell ist es schon möglich. Wie? Keine Ahnung...... (prinzipieller Aufbau schon) |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 12.03.2007, 17:59 Titel: |
|
|
Das was mir eigentlich wichtig ist ist, nur das ich über netzwerk den monitor meines zweitrechners sehen kann. |
|
Nach oben |
|
 |
ThePuppetMaster

Anmeldungsdatum: 18.02.2007 Beiträge: 1839 Wohnort: [JN58JR]
|
Verfasst am: 12.03.2007, 19:50 Titel: |
|
|
WWW.google.de -> VNC
Wenn das selber machen willst, dann beschäftige dich einmal mit Screenshots (API), Komressions (JPG, GIF) und Winsock
Dann verbidnest beides zueinander, schon ... tadaaa
Im grunde musst du nur Screenshots machen, und das ständig. Diese Komprimierst du im JPG oder GIF format, wie du das willst, und überträgst sie zum anderen PC, via Winsock. Dort anzeigen, fertig.
Um das ganze schnellzu bekommen,musst du auf dem anderen PC die Funktionalität überwachen. es is von vorteil, wenn du nichtalles überträgst (den gesammten Bildschirm), sondern nur einen ausschnitt. Der ausschnit, von dem bereich, wo sich was geändert hat.
MfG
TPM _________________ [ WebFBC ][ OPS ][ ToOFlo ][ Wiemann.TV ] |
|
Nach oben |
|
 |
ytwinky

Anmeldungsdatum: 28.05.2005 Beiträge: 2624 Wohnort: Machteburch
|
Verfasst am: 13.03.2007, 00:39 Titel: |
|
|
Ich benutze UltraVNC..
..und schnell, bevor Thorben das sagt:
Naja, eine FreeBASIC-Lösung ist es ja nicht..
..bei WinSock bin ich mir nicht ganz so sicher
Gruß
ytwinky _________________
v1ctor hat Folgendes geschrieben: | Yeah, i like INPUT$(n) as much as PRINT USING.. | ..also ungefähr so, wie ich GOTO.. |
|
Nach oben |
|
 |
alfonsospringer
Anmeldungsdatum: 27.04.2006 Beiträge: 445
|
Verfasst am: 13.03.2007, 20:56 Titel: |
|
|
für ThePuppetMaster's Methode empfehle ich eine Grpße Festplatte, wenn du vor hasst das Programm länger als 1 Minute laufen zu lassen. _________________ Die Antworten zu fast allen Fragen des Lebens findest du entweder im MonsterFAQ oder der Befehlsreferenz - Und wenn du gar nicht mehr weiter weisst ? -> Wikipedia
ALLE RECHTSCHREIBFEHLER DIE ICH MACHE SIND BEABSICHTIGT, DAMIT DIE LEUTE, DIE SPAß DARAN HABEN SOLCHE ZU FINDEN, ETWAS ZU TUN HABEN |
|
Nach oben |
|
 |
Jojo alter Rang

Anmeldungsdatum: 12.02.2005 Beiträge: 9736 Wohnort: Neben der Festplatte
|
Verfasst am: 13.03.2007, 21:20 Titel: |
|
|
wieso denn. die bileder werden doch überschrieben  _________________ » Die Mathematik wurde geschaffen, um Probleme zu lösen, die es nicht gäbe, wenn die Mathematik nicht erschaffen worden wäre.
 |
|
Nach oben |
|
 |
ThePuppetMaster

Anmeldungsdatum: 18.02.2007 Beiträge: 1839 Wohnort: [JN58JR]
|
Verfasst am: 13.03.2007, 22:47 Titel: |
|
|
HÄÄ?!?!?
meine Methode hat 0 mit der Festplatte zu tun... eher mit dem RAM.
es wird ein Screenshot vom Desktop ins RAM gemacht. Das dann im RAM komprimiert, und direkt zum Winsock geschickt. Da entstehthöhstens n Abbild vom Windows-Explorer, der grad auf die Festplatte zugreift
Das Bild auf die Platte legen wäre ganz und garnicht hilfreich. Weder für die Lebensdauer der Platte noch für die Geschwindigkeit der übertragung.
MfG
TPM _________________ [ WebFBC ][ OPS ][ ToOFlo ][ Wiemann.TV ] |
|
Nach oben |
|
 |
Jojo alter Rang

Anmeldungsdatum: 12.02.2005 Beiträge: 9736 Wohnort: Neben der Festplatte
|
Verfasst am: 13.03.2007, 22:48 Titel: |
|
|
joa, es MUSS nicht auf die festplattte gespeichert werden, das is mir klar. ich wollte nur das prinzip verdeutlichen  _________________ » Die Mathematik wurde geschaffen, um Probleme zu lösen, die es nicht gäbe, wenn die Mathematik nicht erschaffen worden wäre.
 |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 14.03.2007, 10:08 Titel: |
|
|
Danke für eure Antworten,
ich hab mich jetzt mal mit Screenshots u.s.w. beschäftigt.
Ich hab eine Funktion, die "BitBlt" verwendet geschrieben, um einen Screenshot zu machen. Aber wie bekomm ich diesen jetzt angezeigt?
Code: |
'----------------------------------------------------------------------------
FUNCTION ScreenShot( hWnd AS HWND ) AS INTEGER
'----------------------------------------------------------------------------
DIM hDC AS HDC
hDC = GetDC( hWnd )
DIM hDC2 AS HDC
DIM Rect AS RECT
DIM bmp AS HBitmap
IF hWnd = 0 THEN
Rect.left = 0
Rect.top = 0
Rect.right = GetSystemMetrics( SM_CXSCREEN )
Rect.bottom = GetSystemMetrics( SM_CYSCREEN )
END IF
GetWindowRect( hWnd , @Rect )
hDC2 = CreateCompatibleDC( hDC )
bmp = CreateCompatibleBitmap( hDC2 , Rect.right , Rect.bottom )
SelectObject( hDC2 , @bmp )
BitBlt( hDC2 , 0 , 0 , Rect.right , Rect.bottom , hDC , 0 , 0 , SRCCOPY )
RETURN true
END FUNCTION
|
MFG Thorben |
|
Nach oben |
|
 |
ThePuppetMaster

Anmeldungsdatum: 18.02.2007 Beiträge: 1839 Wohnort: [JN58JR]
|
Verfasst am: 14.03.2007, 10:29 Titel: |
|
|
Nun ... dafür brauchst du ne Form bzw. ein Fenster.
Dann übergibst du der BitBlt Funktion kein neu erstelltes (unsichtbares) DC, sondern den DC-Handel (hDC) von deiner Form / Fenster.
Und schon wird auf das Fenster der Screenshot platziert.
Allerdings hast du das Problem, wenn du das Bild übertragen willst, das du es zum eien noch komprimieren musst (wäre sehr empfehlenswert), sowie die extraktion der Bitmap-Daten in einen String / Byte-Array.
Wenn du ne JPG Klasse nutzt, dann wird das allerdings schon umgerechnet, und in ein ByteArray kopiert. Das hat den Vorteil, das du nur noch dieses Array her nimms, und es direkt dem Socket übergeben brauchst, zur Übertragung.
MfG
TPM _________________ [ WebFBC ][ OPS ][ ToOFlo ][ Wiemann.TV ] |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 14.03.2007, 19:06 Titel: |
|
|
Thx! Funktioniert 1a.
Ich hab jetzt schon den ganzen Tag versucht eine möglichkeit zu finden den scrennshot zu kompriemieren. Hab aber nichts gefunden.
Kann mir von euch einer Weiter helfen?
MFG Thorben |
|
Nach oben |
|
 |
ytwinky

Anmeldungsdatum: 28.05.2005 Beiträge: 2624 Wohnort: Machteburch
|
Verfasst am: 14.03.2007, 19:48 Titel: |
|
|
Du könntest das Bild mit IrfanView umformen..
..oder mit TugZip oder 7z packen..
Wobei ich die Lösung mit IrfanView bevorzugen würden, jpgs sind schon so gepackt, daß nochmaliges Packen nicht mehr viel bringt  _________________
v1ctor hat Folgendes geschrieben: | Yeah, i like INPUT$(n) as much as PRINT USING.. | ..also ungefähr so, wie ich GOTO.. |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 14.03.2007, 19:54 Titel: |
|
|
Ich meinte das anders. Der Screenshot ist ja noch ein BMP ich möchte ihn ins JPEG format bringen.
MFG Thorben |
|
Nach oben |
|
 |
nemored

Anmeldungsdatum: 22.02.2007 Beiträge: 4704 Wohnort: ~/
|
Verfasst am: 14.03.2007, 20:03 Titel: |
|
|
Geht auch mit IrfanView. Oder einem Bildbearbeitungsprogramm, das jpeg speichern kann. |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 14.03.2007, 20:07 Titel: |
|
|
Sorry, wie oben zusehen möchte ich ein Screenshot machen( der ist aber leider im BMP format bei mir ) und diesen kompriemieren ohen ihn vorher
zu speicher und dann übers Netzwerk verschicken. Also kann ich kein Bildbearbeitungs prog verwenden sondern benötige eine Rutine die das BMP ein JPEG umwandelt.
MFG Thorben |
|
Nach oben |
|
 |
nemored

Anmeldungsdatum: 22.02.2007 Beiträge: 4704 Wohnort: ~/
|
Verfasst am: 14.03.2007, 20:15 Titel: |
|
|
Kommt davon, wenn ich mal wieder nicht richtig lese ...
Das heißt wohl, du brauchst lediglich eine Routine, um ein vorhandenes Bild als JPG zu speichern. |
|
Nach oben |
|
 |
Thorben
Anmeldungsdatum: 26.04.2005 Beiträge: 173 Wohnort: SH
|
Verfasst am: 14.03.2007, 20:18 Titel: |
|
|
Fast! Ich will dieses Bild ja nicht speicher sondern kopriemieren und dann übers Netzwerk schicken. Und auf einem anderen Computer nur anzeigen lassen( nicht speichern )
MFG Thorben |
|
Nach oben |
|
 |
Mao
Anmeldungsdatum: 25.09.2005 Beiträge: 4409 Wohnort: /dev/hda1
|
Verfasst am: 14.03.2007, 20:21 Titel: |
|
|
Hm, evtl. kannst du da was mit dem Komprimierungsalgo in der fbgfx-Lib anfangen. Die BMP wird dann damit komprimiert. Musst natürlich auf der Empfängerseite dekomprimieren.
Das Thema hatten wir übrigens gerade erst hier. Und zwar beim Thema "RAR und ZIP entpacken" (oder so ähnlich). _________________ Eine handvoll Glück reicht nie für zwei.
--
 |
|
Nach oben |
|
 |
ThePuppetMaster

Anmeldungsdatum: 18.02.2007 Beiträge: 1839 Wohnort: [JN58JR]
|
Verfasst am: 15.03.2007, 02:24 Titel: |
|
|
Is zwar VB, aber das hilft dir vieleicht die "Bitmap" daten (eigentlich is das ne cDIB) zu einem Strign zu verwandeln.
Kannst dasja erstmal austesten. Wenn das hast, dann suchst mal nach JPEG-Class, oder, wenn nix findest, kann ich dir noch den Code in VB posten.
Code: | '****************************************************************
'* VB file: cDIB.cls... by Ray Mercer
'* created: 12/1999 by Ray Mercer
'* uploaded: 2/2000
'* modified: 2/25/2000 by Ray Mercer
'* Patrick Pasteels pointed out a bug in my code
'* -fixed: ReDim m_memBitmapInfo(0 To 39) now correctly equals 40 bytes
'*
'*
'* Copyright (C) 1999 - 2000 Ray Mercer. All rights reserved.
'* Latest version can be downloaded from http://www.shrinkwrapvb.com
'****************************************************************
Option Explicit
Private Const BMP_MAGIC_COOKIE As Integer = 19778 'this is equivalent to ascii string "BM"
'//BITMAP DEFINES (from mmsystem.h)
Private Type BITMAPFILEHEADER '14 bytes
bfType As Integer '"magic cookie" - must be "BM"
bfSize As Long
bfReserved1 As Integer
bfReserved2 As Integer
bfOffBits As Long
End Type
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
Red As Byte
Green As Byte
Blue As Byte
Reserved As Byte
End Type
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
'/* constants for the biCompression field */
Private Const BI_RGB As Long = 0&
'#define BI_RLE8 1L
'#define BI_RLE4 2L
'#define BI_BITFIELDS 3L
'for use with AVIFIleInfo
'Private Type AVI_FILE_INFO '108 bytes?
' dwMaxBytesPerSecond As Long
' dwFlags As Long
' dwCaps As Long
' dwStreams As Long
' dwSuggestedBufferSize As Long
' dwWidth As Long
' dwHeight As Long
' dwScale As Long
' dwRate As Long
' dwLength As Long
' dwEditCount As Long
' szFileType As String * 64
'End Type
'Private Declare Function CreateDIBSection_256 Lib "GDI32.DLL" Alias "CreateDIBSection" (ByVal hdc As Long, _
' ByVal pbmi As BITMAPINFO_256, _
' ByVal iUsage As Long, _
' ByRef ppvBits As Long, _
' ByVal hSection As Long, _
' ByVal dwOffset As Long) As Long 'hBitmap
Private Declare Function GetProcessHeap Lib "kernel32.dll" () As Long 'handle
Private Declare Function HeapAlloc Lib "kernel32.dll" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal dwBytes As Long) As Long 'Pointer to mem
Private Declare Function HeapFree Lib "kernel32.dll" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal lpMem As Long) As Long 'BOOL
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef dest As Any, ByRef src As Any, ByVal dwLen As Long)
Private Const HEAP_ZERO_MEMORY As Long = &H8
Private m_memBits() As Byte
Private m_memBitmapInfo() As Byte
Private m_bih As BITMAPINFOHEADER
Private m_bfh As BITMAPFILEHEADER
Public Function CreateFromFile(ByVal filename As String) As Boolean
Dim hFile As Long
If Not ExistFile(filename) Then
MsgBox "File does not exist:" & vbCrLf & filename, vbCritical, App.title
Exit Function
End If
hFile = FreeFile()
'<====ERROR TRAP ON
On Error Resume Next
Open filename For Binary Access Read As #hFile
If Err Then
If Err.Number = 70 Then
MsgBox "File is locked - cannot access:" & vbCrLf & filename, vbCritical, App.title
Else
MsgBox Err.Description, vbInformation, App.title
End If
Exit Function 'assume file was not opened
End If
On Error GoTo 0
'====>ERROR TRAP OFF
'OK, file is opened - now for the real algorithm...
Get #hFile, , m_bfh 'get the BITMAPFILEHEADER this identifies the bitmap
If m_bfh.bfType <> BMP_MAGIC_COOKIE Then 'this is not a BMP file
MsgBox "File is not a supported bitmap format:" & vbCrLf & filename, vbInformation, App.title
Close #hFile
Exit Function
Else
'now get the info header
Get #hFile, Len(m_bfh) + 1, m_bih 'start at the 15th byte
'now get the bitmap bits
ReDim m_memBits(0 To m_bih.biSizeImage - 1)
Get #hFile, m_bfh.bfOffBits + 1, m_memBits
'and BitmapInfo variable-length UDT
ReDim m_memBitmapInfo(0 To m_bfh.bfOffBits - 14) 'don't need first 14 bytes (fileinfo)
Get #hFile, Len(m_bfh) + 1, m_memBitmapInfo
Close #hFile 'Close file
End If
CreateFromFile = True 'indicate success
' Debug.Print "BitCount: " & vbTab & vbTab & bih.biBitCount
' Debug.Print "ClrImportant: " & vbTab & bih.biClrImportant
' Debug.Print "ClrUsed: " & vbTab & vbTab & bih.biClrUsed
' Debug.Print "Compression: " & vbTab & "&H" & Hex$(bih.biCompression)
' Debug.Print "Height: " & vbTab & vbTab & bih.biHeight
' Debug.Print "Planes: " & vbTab & vbTab & bih.biPlanes 'always 1
' Debug.Print "Size: " & vbTab & vbTab & vbTab & bih.biSize
' Debug.Print "SizeImage: " & vbTab & vbTab & bih.biSizeImage
' Debug.Print "Width: " & vbTab & vbTab & vbTab & bih.biWidth
' Debug.Print "XPelsPerMeter: " & vbTab & bih.biXPelsPerMeter 'usually 0
' Debug.Print "YPelsPerMeter: " & vbTab & bih.biYPelsPerMeter 'usually 0
End Function
Public Function CreateFromPackedDIBPointer(ByRef pDIB As Long) As Boolean
Debug.Assert pDIB <> 0
'Creates a full-color (no palette) DIB from a pointer to a full-color memory DIB
'get the BitmapInfoHeader
Call CopyMemory(ByVal VarPtr(m_bih.biSize), ByVal pDIB, Len(m_bih))
If m_bih.biBitCount < 16 Then
Debug.Print "Error! DIB was less than 16 colors."
Exit Function 'only supports high-color or full-color dibs
End If
'now get the bitmap bits
If m_bih.biSizeImage < 1 Then Exit Function 'return False
ReDim m_memBits(0 To m_bih.biSizeImage - 1)
Call CopyMemory(m_memBits(0), ByVal pDIB + 40, m_bih.biSizeImage)
'and BitmapInfo variable-length UDT
ReDim m_memBitmapInfo(0 To 39) 'don't need first 14 bytes (fileinfo)
Call CopyMemory(m_memBitmapInfo(0), m_bih, Len(m_bih))
'create a file header
With m_bfh
.bfType = BMP_MAGIC_COOKIE
.bfSize = 55 + m_bih.biSizeImage 'size of file as written to disk
.bfReserved1 = 0&
.bfReserved2 = 0&
.bfOffBits = 54 'BitmapInfoHeader + BitmapFileHeader
End With
'and return True
CreateFromPackedDIBPointer = True
End Function
Public Function WriteToFile(ByVal filename As String) As Boolean
Dim hFile As Integer
On Error Resume Next
hFile = FreeFile()
Open filename For Binary As hFile
Put hFile, 1, m_bfh
Put hFile, Len(m_bfh) + 1, m_memBitmapInfo
Put hFile, , m_memBits
Close hFile
WriteToFile = True
End Function
Private Function ExistFile(ByVal sSpec As String) As Boolean
On Error Resume Next
Call FileLen(sSpec)
ExistFile = (Err = 0)
End Function
Public Property Get BitCount() As Long
BitCount = m_bih.biBitCount
End Property
Public Property Get Height() As Long
Height = m_bih.biHeight
End Property
Public Property Get Width() As Long
Width = m_bih.biWidth
End Property
Public Property Get Compression() As Long
Compression = m_bih.biCompression
End Property
Public Property Get SizeInfoHeader() As Long
SizeInfoHeader = m_bih.biSize
End Property
Public Property Get SizeImage() As Long
SizeImage = m_bih.biSizeImage
End Property
Public Property Get Planes() As Long
Planes = m_bih.biPlanes
End Property
Public Property Get ClrImportant() As Long
ClrImportant = m_bih.biClrImportant
End Property
Public Property Get ClrUsed() As Long
ClrUsed = m_bih.biClrUsed
End Property
Public Property Get XPPM() As Long
XPPM = m_bih.biXPelsPerMeter
End Property
Public Property Get YPPM() As Long
YPPM = m_bih.biYPelsPerMeter
End Property
Public Property Get FileType() As Long
FileType = m_bfh.bfType
End Property
Public Property Get SizeFileHeader() As Long
SizeFileHeader = m_bfh.bfSize
End Property
Public Property Get BitOffset() As Long
BitOffset = m_bfh.bfOffBits
End Property
Public Property Get PointerToBits() As Long
PointerToBits = VarPtr(m_memBits(0))
End Property
Public Property Get PointerToBitmapInfo() As Long
PointerToBitmapInfo = VarPtr(m_memBitmapInfo(0))
End Property
Public Property Get SizeBitmapInfo() As Long
SizeBitmapInfo = UBound(m_memBitmapInfo()) + 1
End Property |
MfG
TPM _________________ [ WebFBC ][ OPS ][ ToOFlo ][ Wiemann.TV ] |
|
Nach oben |
|
 |
|