|
Postada em 21/08/2009 16:01 hs
pessoal alguem ai sabe como girar uma imagem carregada em uma picture? via codigo
|
|
|
|
PH1959
|
SÃO JOSÉ DOS CAMPOS SP - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 24/08/2009 12:50 hs
dá uma olhada neste tópico aki...
|
|
|
rdeletric
|
SÃO JOSÉ DO RIO PRETO SP - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 25/08/2009 11:30 hs
'Num form criar uma picture e um command button
Private Type POINTAPI x As Long y As Long End Type
Dim Pt(0 To 2) As POINTAPI
Private Declare Function PlgBlt Lib "gdi32" ( _ ByVal hdcDest As Long, _ lpPoint As POINTAPI, _ ByVal hdcSrc As Long, _ ByVal nXSrc As Long, _ ByVal nYSrc As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal hbmMask As Long, _ ByVal xMask As Long, _ ByVal yMask As Long _ ) As Long
Private Sub Form_Load() With Picture1 .AutoRedraw = True .AutoSize = True .BorderStyle = 0 .Appearance = 0 .ScaleMode = vbPixels 'your favorite picture here .Picture = LoadPicture("c:sua imagem.jpg") ' aqui o caminho da sua imagem End With
Me.ScaleMode = vbPixels
End Sub
Private Sub Rotacionar90(picsrc As PictureBox) Dim picWidth As Long Dim picHeight As Long
picWidth = picsrc.Width picHeight = picsrc.Height
Pt(2).x = 0 Pt(2).y = 0 Pt(0).x = picHeight Pt(0).y = 0 Pt(1).x = picHeight Pt(1).y = picWidth
If picWidth > picHeight Then picsrc.Height = picWidth Else picsrc.Width = picHeight End If Call PlgBlt(picsrc.hDC, Pt(0), picsrc.hDC, 0, 0, picWidth, picHeight, ByVal 0&, ByVal 0&, ByVal 0&)
picsrc.Width = picHeight picsrc.Height = picWidth picsrc.Refresh
End Sub
' chamar a funcao rotacionar Private Sub Command1_Click() Call Rotacionar90(Picture1) End Sub
|
|
|
rdeletric
|
SÃO JOSÉ DO RIO PRETO SP - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 25/08/2009 11:33 hs
'Num form criar uma picture e um command button
Private Type POINTAPI x As Long y As Long End Type
Dim Pt(0 To 2) As POINTAPI
Private Declare Function PlgBlt Lib "gdi32" ( _ ByVal hdcDest As Long, _ lpPoint As POINTAPI, _ ByVal hdcSrc As Long, _ ByVal nXSrc As Long, _ ByVal nYSrc As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long, _ ByVal hbmMask As Long, _ ByVal xMask As Long, _ ByVal yMask As Long _ ) As Long
Private Sub Form_Load() With Picture1 .AutoRedraw = True .AutoSize = True .BorderStyle = 0 .Appearance = 0 .ScaleMode = vbPixels 'your favorite picture here .Picture = LoadPicture("c:sua imagem.jpg") ' aqui o caminho da sua imagem End With
Me.ScaleMode = vbPixels
End Sub
Private Sub Rotacionar90(picsrc As PictureBox) Dim picWidth As Long Dim picHeight As Long
picWidth = picsrc.Width picHeight = picsrc.Height
Pt(2).x = 0 Pt(2).y = 0 Pt(0).x = picHeight Pt(0).y = 0 Pt(1).x = picHeight Pt(1).y = picWidth
If picWidth > picHeight Then picsrc.Height = picWidth Else picsrc.Width = picHeight End If Call PlgBlt(picsrc.hDC, Pt(0), picsrc.hDC, 0, 0, picWidth, picHeight, ByVal 0&, ByVal 0&, ByVal 0&)
picsrc.Width = picHeight picsrc.Height = picWidth picsrc.Refresh
End Sub
' chamar a funcao rotacionar Private Sub Command1_Click() Call Rotacionar90(Picture1) End Sub
|
|
|
|