BITMAP COM BD NO VB

CASPEREARK 09/03/2004 01:12:03
#14565
Olá a todos,

Estou fazendo um programa em vb, e em cada registro tem uma imagem de bitmap (atribuida pelo tipo do campo Object OLE) tá mas como faço para exibi-lo quando seleciono o registro através de um listview em um picbox ou imagebox!

Se puder me ajudar serei grato, e se você leu também obrigado!

Boa sorte!
MFVB 15/03/2004 09:34:38
#15406
Resposta escolhida
Eu faço assim para guardar a imagem em um campo image,Espero que ajude.


Public Sub GRAVAIMAGEM(XFIG As String)
If Len(Trim(XFIG)) 0 Then
Dim file_num As String
file_num = FreeFile
Open xlocal For Binary Access Read As #file_num
file_length = LOF(file_num)
If file_length 0 Then
num_blocks = file_length / BLOCK_SIZE
left_over = file_length Mod BLOCK_SIZE '

ReDim bytes(BLOCK_SIZE)
For block_num = 1 To num_blocks
Get #file_num, , bytes()
RECORDSET!ICONE.AppendChunk bytes()
Next block_num '

If left_over 0 Then
ReDim bytes(left_over)
Get #file_num, , bytes()
RECORDSET!ICONE.AppendChunk bytes()
End If
End If
Close #file_num
End If

End Sub

Se houver dúvidas é só falar,
Tópico encerrado , respostas não são mais permitidas