国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
VB入門技巧N例(8)
25.如何打印PictureBox中的所有控件

添加另外一個PictureBox,然后:
  1. Private Const WM_PAINT = &HF
  2. Private Const WM_PRINT = &H317
  3. Private Const PRF_CLIENT = &H4&
  4. Private Const PRF_CHILDREN = &H10&
  5. Private Const PRF_OWNED = &H20&
  6. Private Const PHYSICALOFFSETX As Long = 112
  7. Private Const PHYSICALOFFSETY As Long = 113
  8. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd _
  9. As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  10. Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nindex _
  11. As Long) As Long
  12. private Sub Form_Load()
  13.     Picture1.AutoRedraw = True
  14.     Picture2.AutoRedraw = True
  15.     Picture2.BorderStyle = 0
  16.     Picture2.Visible = False
  17. End Sub
  18. Private Sub Command2_Click()
  19.     Dim retval As Long, xmargin As Single, ymargin As Single
  20.     Dim x As Single, y As Single
  21.     x = 1: y = 1
  22.     With Printer
  23.       .ScaleMode = vbInches
  24.       xmargin = GetDeviceCaps(.hdc, PHYSICALOFFSETX)
  25.       xmargin = (xmargin * .TwipsPerPixelX) / 1440
  26.       ymargin = GetDeviceCaps(.hdc, PHYSICALOFFSETY)
  27.       ymargin = (ymargin * .TwipsPerPixelY) / 1440
  28.       Picture2.Width = Picture1.Width
  29.       Picture2.Height = Picture1.Height
  30.       DoEvents
  31.       Picture1.SetFocus
  32.       retval = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hdc, 0)
  33.       retval = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hdc, _
  34.       PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
  35.       DoEvents
  36.       Printer.Print ""
  37.       .PaintPicture Picture2.Image, x - xmargin, y - ymargin
  38.       .EndDoc
  39.       End With
  40. End Sub
復制代碼

26.冒泡排序
  1. Sub BubbleSort(List() As Double)
  2. Dim First As Double, Last As Double
  3. Dim i As Integer, j As Integer
  4. Dim Temp As Double
  5. First = LBound(List)
  6. Last = UBound(List)
  7. For i = First To Last - 1
  8. For j = i + 1 To Last
  9. If List(i) > List(j) Then
  10. Temp = List(j)
  11. List(j) = List(i)
  12. List(i) = Temp
  13. End If
  14. Next j
  15. Next i
  16. End Sub
復制代碼
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VB截屏(拷貝屏幕圖像)代碼
QGraphicsView編程函數(shù)
如何讓字體逆時鐘轉(zhuǎn)90度°
選擇任意單元格,該行自動填充顏色及保留復制粘貼功能的VBA代碼
DrawFrameControl
VB6把攝像頭的圖像放入 Image 或 PictureBox 里
更多類似文章 >>
生活服務(wù)
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服