Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27-09-2007, 15:39:55
Avatar de Alella
Alella Alella is offline
Moderador
 
Registrado: mar 2004
Ubicación: BARCELONA - ESPAÑA
Posts: 985
Alella Valoración +2
Predeterminado

Hola, que tal.

Prueba con esto:

Código:

Option Explicit

Private Declare Function GetBitmapBits Lib "gdi32" _
   (ByVal hBitmap As Long, ByVal dwCount As Long, _
   lpBits As Any) As Long

Private Declare Function SetBitmapBits Lib "gdi32" _
   (ByVal hBitmap As Long, ByVal dwCount As Long, _
   lpBits As Any) As Long
   
Private Declare Function GetObject Lib "gdi32" Alias _
   "GetObjectA" (ByVal hObject As Long, ByVal nCount _
   As Long, lpObject As Any) As Long

    
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



Private Function GetBitmapData(pic As PictureBox) As String

    Dim BitmapData As String
    Dim BitmapBytes As Long
    
    Dim BMP As BITMAP
    
    GetObject pic.Image.Handle, Len(BMP), BMP

    BitmapBytes = BMP.bmHeight * BMP.bmWidth * (BMP.bmBitsPixel \ 8)
    
    BitmapData = Space$(BitmapBytes)
    GetBitmapBits pic.Image.Handle, BitmapBytes, ByVal BitmapData
    
    GetBitmapData = BitmapData
End Function

Private Sub Command1_Click()

MsgBox GetBitmapData(Picture1) = GetBitmapData(Picture2)

End Sub

Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture1.AutoSize = True
Picture2.AutoSize = True

End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.PSet (X, Y), RGB(255, 255, 255)
Picture1.Refresh
End Sub

Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.PSet (X, Y), RGB(255, 255, 255)
Picture2.Refresh
End Sub
Ya nos contarás.
__________________
Un saludo.

Alfredo
Barcelona-España
_________________
Visual Basic
Videos Programacion
Foro Programacion
Tutoriales Programacion
Responder Con Cita