Sayfa: [1]   Aşağı git
  Yazdır  
Gönderen Konu: Ekran resmi çek  (Okunma Sayısı 769 defa)
0 Üye ve 1 Ziyaretçi konuyu incelemekte.
sebo
Ziyaretçi
« : 23 Ocak 2008, 17:20:58 »

Alıntı
Private Declare Sub AVIStreamCreate Lib "avifil32.dll" (ByVal ppavi As Long, ByVal lParam1 As Long, ByVal lParam2 As Long, ByRef pclsidHandler As Long)

    Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer

    Private Declare Function CreateCompatibleDC Lib "GDI32" (ByVal hDC As Integer) As Integer

    Private Declare Function CreateCompatibleBitmap Lib "GDI32" (ByVal hDC As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer

    Private Declare Function GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc As Integer, ByVal nIndex As Integer) As Integer

    Private Declare Function SelectObject Lib "GDI32" (ByVal hDC As Integer, ByVal hObject As Integer) As Integer

    Private Declare Function BitBlt Lib "GDI32" (ByVal srchDC As Integer, ByVal srcX As Integer, ByVal srcY As Integer, ByVal srcW As Integer, ByVal srcH As Integer, ByVal desthDC As Integer, ByVal destX As Integer, ByVal destY As Integer, ByVal op As Integer) As Integer

    Private Declare Function DeleteDC Lib "GDI32" (ByVal hDC As Integer) As Integer

    Private Declare Function DeleteObject Lib "GDI32" (ByVal hObj As Integer) As Integer

    Const SRCCOPY As Integer = &HCC0020
    Private oBackground As Bitmap
    Private FW, FH As Integer






    Protected Sub CaptureScreen()

      Dim hSDC, hMDC As Integer
      Dim hBMP, hBMPOld As Integer
      Dim r As Integer

      hSDC = CreateDC("DISPLAY", "", "", "")
      hMDC = CreateCompatibleDC(hSDC)

      FW = GetDeviceCaps(hSDC, Karizmatik
      FH = GetDeviceCaps(hSDC, 10)
      hBMP = CreateCompatibleBitmap(hSDC, FW, FH)

      hBMPOld = SelectObject(hMDC, hBMP)
      r = BitBlt(hMDC, 0, 0, FW, FH, hSDC, 0, 0, 13369376)
      hBMP = SelectObject(hMDC, hBMPOld)

      r = DeleteDC(hSDC)
      r = DeleteDC(hMDC)

      oBackground = Image.FromHbitmap(New IntPtr(hBMP))
      DeleteObject(hBMP)

    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load


      CaptureScreen()
      Me.BackgroundImage = oBackground

    End Sub

'
Linklerin Görülmesine Izin Verilmiyor
Linki Görebilmek Için Üye Ol veya Giris Yap
www.visualbasicturk.net


Logged
sessizx
Ziyaretçi
« Yanıtla #1 : 17 Mart 2008, 03:17:15 »

güzel ama bu hazır kodları nasıl yerleştirecegiz Gülümseme
Logged
kamele
Acemi Üye
**

Karma: 0
Offline Offline

Cinsiyet: Bay
Mesaj Sayısı: 22


Üyelik Bilgileri
« Yanıtla #2 : 02 Ekim 2008, 13:55:50 »

bu ne ya önüne gelen saçma sapan abuk subuk açıklama yapmadan kod koyuyor...
Logged
tr0jen
Acemi Üye
**

Karma: 0
Offline Offline

Cinsiyet: Bay
Mesaj Sayısı: 34


Üyelik Bilgileri
« Yanıtla #3 : Dün 22:53:36 »

arkadasım istersen bu kodlarla yap daha kısa ve kesin sonuc

forma bir buton ekle ve click olayına

   Dim ekransize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
        Dim ekranblack As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
        Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(ekranblack)
        g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ekransize)
        Dim SaveFileDialog As New SaveFileDialog
        SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        SaveFileDialog.Filter = "Jpg Files (*.Jpg)|*.jpg |Bmp Files (*.Bmp) | *.Bmp | All Files (*.*)|*.*" ' Burada istedigin formatları n uzantılarını yazabilirsin ama yalnız boyle ekle ’ All Files (*.uzantı ismi)|*.uzantı ismi ’

        If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
            Dim FileName As String = SaveFileDialog.FileName
            ekranblack.Save(FileName, System.Drawing.Imaging.ImageFormat.Jpeg)

        End If

yaz
Logged
Sayfa: [1]   Yukarı git
  Yazdır  
GoogleTagged

 
Gitmek istediğiniz yer: