| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3079 人关注过本帖
标题:[求助]VB能否让某个图片旋转一定角度显示?
只看楼主 加入收藏
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
 问题点数:0 回复次数:10 
[求助]VB能否让某个图片旋转一定角度显示?
VB能否让某个图片旋转一定角度显示?
搜索更多相关主题的帖子: 角度 
2007-06-14 09:15
lisypro
Rank: 4
等 级:业余侠客
威 望:3
帖 子:695
专家分:216
注 册:2005-9-25
收藏
得分:0 

neng


长期承接管理系统
代做各种vb/ / vc小程序
QQ:82341763
手机:13623290828
群号 11619730
2007-06-14 11:16
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
how?

2007-06-14 11:18
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
收藏
得分:0 
这个
WkIGeF6Y.rar (93.44 KB) [求助]VB能否让某个图片旋转一定角度显示?


旋转度数:0-360

[此贴子已经被作者于2007-6-14 14:17:17编辑过]


其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2007-06-14 14:16
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
谢谢!
使用pset,是不是太慢了

2007-06-14 15:51
btxdlibin
Rank: 2
等 级:论坛游民
帖 子:8
专家分:10
注 册:2007-6-2
收藏
得分:0 
对90度的旋转用paintpicture
2007-06-16 19:03
心中有剑
Rank: 2
等 级:新手上路
威 望:5
帖 子:611
专家分:0
注 册:2007-5-18
收藏
得分:0 

模块里
Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, _
lpPoint As POINTS2D, _
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

Global Const NotPI = 3.14159265238 / 180

'--------------------------------------------------------------------------------
Public Type POINTS2D
x As Long
y As Long
End Type

窗体里面
Option Explicit

Dim FRAME As Integer

Private Sub DanRotate(ByRef picDestHdc As Long, xPos As Long, yPos As Long, _
ByVal Angle As Long, _
ByRef picSrcHdc As Long, srcXoffset As Long, srcYoffset As Long, _
ByVal srcWidth As Long, ByVal srcHeight As Long)

Dim Points(3) As POINTS2D
Dim DefPoints(3) As POINTS2D
Dim ThetS As Single, ThetC As Single
Dim ret As Long

'SET LOCAL AXIS / ALIGNMENT
Points(0).x = -srcWidth * 0.5
Points(0).y = -srcHeight * 0.5

Points(1).x = Points(0).x + srcWidth
Points(1).y = Points(0).y

Points(2).x = Points(0).x
Points(2).y = Points(0).y + srcHeight

'ROTATE AROUND Z-AXIS
ThetS = Sin(Angle * NotPI)
ThetC = Cos(Angle * NotPI)
DefPoints(0).x = (Points(0).x * ThetC - Points(0).y * ThetS) + xPos
DefPoints(0).y = (Points(0).x * ThetS + Points(0).y * ThetC) + yPos

DefPoints(1).x = (Points(1).x * ThetC - Points(1).y * ThetS) + xPos
DefPoints(1).y = (Points(1).x * ThetS + Points(1).y * ThetC) + yPos

DefPoints(2).x = (Points(2).x * ThetC - Points(2).y * ThetS) + xPos
DefPoints(2).y = (Points(2).x * ThetS + Points(2).y * ThetC) + yPos

PlgBlt picDestHdc, DefPoints(0), picSrcHdc, srcXoffset, srcYoffset, srcWidth, srcHeight, 0, 0, 0

End Sub

Private Sub Command1_Click()

Unload Me
End

End Sub

Private Sub Command2_Click()
Dim tel As Integer

'Reset & start FPS counter
FRAME = 0
Timer1.Enabled = True

For tel = 0 To 360 Step 1
picBck.Cls
DanRotate picBck.hDC, 128, 128, tel, picCol.hDC, 0, 0, 128, 128
picBck.Refresh
FRAME = FRAME + 1
DoEvents
Next tel

'Stop FPS timer
Timer1.Enabled = False

End Sub

Private Sub Timer1_Timer()

Label1.Caption = FRAME & " fps"
FRAME = 0

End Sub


2007-06-16 21:40
心中有剑
Rank: 2
等 级:新手上路
威 望:5
帖 子:611
专家分:0
注 册:2007-5-18
收藏
得分:0 
回复:(dragonfly)[求助]VB能否让某个图片旋转一定角...
HTiKQTAh.zip (157.04 KB) [求助]VB能否让某个图片旋转一定角度显示?



2007-06-16 21:41
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
收藏
得分:0 
pset太慢,api太复杂,还有什么方法呢?

/images/2011/147787/2011051411021524.jpg" border="0" />
2007-06-16 22:16
dragonfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:1024
专家分:0
注 册:2006-3-20
收藏
得分:0 
回复:(心中有剑)回复:(dragonfly)[求助]VB能否让...
谢谢

2007-06-18 09:17
快速回复:[求助]VB能否让某个图片旋转一定角度显示?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.107171 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved