現在用一個PICTUREBOX裝載了圖片.但圖片太大.有沒有屬性可以設置圖片在PICTUREBOX里完整顯示呢?就是縮略圖的效果那樣.

miaomiaoga 2006-10-12 06:27:29
在VB6中可以實現嗎?還是得用其它的圖形控件?
...全文
353 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
explore_xu 2006-11-27
  • 打赏
  • 举报
回复
Picture1.PaintPicture LoadPicture("D:\WALLPAPER\050818fengjing20.jpg"), 0, 0, Picture1.Width, Picture1.Height
wjhcjg 2006-11-27
  • 打赏
  • 举报
回复
up
cangwu_lee 2006-11-22
  • 打赏
  • 举报
回复
csdnzl 2006-11-22
  • 打赏
  • 举报
回复
可以用滚动条,MSDN上面有例子
oowingoo 2006-11-22
  • 打赏
  • 举报
回复
学习
miaomiaoga 2006-10-17
  • 打赏
  • 举报
回复
俺找了个.挺好用.就是速度太太太慢.
Private Const SRCCOPY = &HCC0020
Private Const Pi = 3.14

'//For image rotation
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long


Public Sub bmp_rotate(pic1 As PictureBox, pic2 As PictureBox, ByVal theta)
Dim c1x As Integer, c1y As Integer
Dim c2x As Integer, c2y As Integer
Dim A As Single
Dim p1x As Integer, p1y As Integer
Dim p2x As Integer, p2y As Integer
Dim n As Integer, r As Integer

c1x = pic1.ScaleWidth \ 2
c1y = pic1.ScaleHeight \ 2
c2x = pic2.ScaleWidth \ 2
c2y = pic2.ScaleHeight \ 2
If c2x < c2y Then n = c2y Else n = c2x
n = n - 1
pic1hDC = pic1.hdc
pic2hDC = pic2.hdc
For p2x = 0 To n
For p2y = 0 To n
If p2x = 0 Then A = Pi / 2 Else A = Atn(p2y / p2x)
r = Sqr(1& * p2x * p2x + 1& * p2y * p2y)
p1x = r * Cos(A + theta)
p1y = r * Sin(A + theta)
c0& = GetPixel(pic1hDC, c1x + p1x, c1y + p1y)
c1& = GetPixel(pic1hDC, c1x - p1x, c1y - p1y)
c2& = GetPixel(pic1hDC, c1x + p1y, c1y - p1x)
c3& = GetPixel(pic1hDC, c1x - p1y, c1y + p1x)
If c0& <> -1 Then SetPixel pic2hDC, c2x + p2x, c2y + p2y, c0
If c1& <> -1 Then SetPixel pic2hDC, c2x - p2x, c2y - p2y, c1
If c2& <> -1 Then SetPixel pic2hDC, c2x + p2y, c2y - p2x, c2
If c3& <> -1 Then SetPixel pic2hDC, c2x - p2y, c2y + p2x, c3
Next
Next
End Sub



Call bmp_rotate(PictureCardImage, Picture2, 3.14 / -2)
海贼王大妈 2006-10-13
  • 打赏
  • 举报
回复
不错,不错,正是我想要的
谢谢了
miaomiaoga 2006-10-13
  • 打赏
  • 举报
回复
成功呢!加分!
ZOU_SEAFARER 2006-10-12
  • 打赏
  • 举报
回复
zq972(旅游归来,好累……) 方法好,
IMAGE 加载的图片有矢真!!
object.PaintPicture picture, x1, y1, width1, height1, x2, y2, width2, height2, opcode

zq972 2006-10-12
  • 打赏
  • 举报
回复
pic.AutoRedraw = True
pic.PaintPicture pic.Picture, 0, 0, pic.Width, pic.Height
happy_sea 2006-10-12
  • 打赏
  • 举报
回复
用image控件,把stretch属性设置为true就行了。
用picturebox控件虽然也能实现,不过要复杂得多而且浪费资源。
miaomiaoga 2006-10-12
  • 打赏
  • 举报
回复
我現在就去試一下.謝謝.:)

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧