Private Sub Form_Load()
Image1Stretch = True
Picture1AutoRedraw = True
Picture2AutoRedraw = True
Picture2Visible = False
For x = 0 To Picture1ScaleWidth Step ScreenTwipsPerPixelX
For y = 0 To Picture1ScaleHeight Step ScreenTwipsPerPixelY
Picture2PSet (Picture1ScaleHeight - y, x), Picture1Point(x, y)
Next y
Next x
Picture2Picture = Picture2Image
Picture2Visible = True
End Sub
Private Sub Command1_Click()
If Len(Command1Tag) Then
Image1Picture = Picture2Picture
Image1Width = 60 ScreenTwipsPerPixelX
Image1Height = 50 ScreenTwipsPerPixelY
Command1Tag = ""
Else
Image1Picture = Picture1Picture
Image1Width = 50 ScreenTwipsPerPixelX
Image1Height = 60 ScreenTwipsPerPixelY
Command1Tag = 1
End If
End Sub
1开启DW后,在CSS新建一个定义样式,建立好后双击打开样式。
2在样式中选择背景--点击浏览--插入背景。如图:
3插入背景后,在区块中将转为块,便能给制定左右像素,移动,如下图所示:
4然后在方框中--给左右像素即可移动。
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Type Bitmap
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Sub ReverseImage(img As StdPicture, Optional UpDownOrLeftRight As Boolean = False)
With img
Dim BmpInfo As Bitmap
GetObject Handle, Len(BmpInfo), BmpInfo
Dim BytesPixel As Integer
BytesPixel = BmpInfobmBitsPixel / 8
Dim Bits() As Byte
ReDim Bits(BmpInfobmWidthBytes - 1, BmpInfobmHeight - 1)
GetBitmapBits Handle, BmpInfobmWidthBytes BmpInfobmHeight, Bits(0, 0)
Dim rBits() As Byte
ReDim rBits(BmpInfobmWidthBytes - 1, BmpInfobmHeight - 1)
Dim Y As Integer, X As Integer
Dim p As Integer
If UpDownOrLeftRight Then
Dim rR As Integer, sR As Integer
For Y = BmpInfobmHeight - 1 To 0 Step -1
rR = BmpInfobmHeight - 1 - Y
For X = 0 To BmpInfobmWidthBytes - 1
rBits(X, rR) = Bits(X, Y)
Next X
Next Y
Else
Dim rIndex As Integer
Dim sIndex As Integer
For Y = 0 To BmpInfobmHeight - 1
For X = BmpInfobmWidth - 1 To 0 Step -1
sIndex = X BytesPixel
rIndex = (BmpInfobmWidth - 1 - X) BytesPixel
For p = sIndex To sIndex + 2
rBits(rIndex, Y) = Bits(p, Y)
rIndex = rIndex + 1
Next
Next X
Next Y
End If
Call SetBitmapBits(Handle, BmpInfobmWidthBytes BmpInfobmHeight, rBits(0, 0))
End With
End Sub1、首先,打开dw编辑器,新建html文件。
2、其次在indexhtml中的标签中,输入css代码。
3、最后浏览器运行indexhtml页面,此时背景被设置为平铺在html页面上。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)