|
雨滴式的显示图片 (cloud 转贴)(2) hMemDc, 0, i, SRCCOPY) Next j Next Call DeleteDC(hMemDc) End Sub
Private Sub Form_Load() Dim i As Long Picture2.ScaleMode = 3 '设定成Pixel的度量单位 '设定待Display的图 Set Picture1 = LoadPicture("c:\windows\素还真.bmp") ' ^^^^^^^^^^^^^^^^^^^^^^ ' Load the picture we want to show End Sub 返回
Shrinking Icons Down to Size Abstract You can use the Windows application programming interface (API) BitBlt function to modify the size of an icon. This article explains how to enlarge or shrink an icon.
Modifying an Icon's Size You can use the Windows application programming interface (API) BitBlt function to create an icon that is smaller or larger than the original icon. The BitBlt function copies a memory device context to another memory device context. (A memory device context is a block of memory that represents a display surface, sUCh as an Image or Picture Box control. See Tip 31: "Creating the Windows Wallpaper Effect for a complete explanation of the BitBlt function.)
In the example program below, we first load an icon into an Image control. Then we modify the Image control's Height and Width properties so the icon becomes 75 percent smaller than its original size. The BitBlt function is then used to copy the icon stored in the Image control to the Picture Box control.
Example Program 1. Create a new project in Visual Basic. Form1 is created by default. 2. Add the following Constant and Declare statements to the General Declarations section of Form1 (note that the Declare statement must be typed as a single line of code):
Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer,
|