home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form frmBMRotate Caption = "Bitmap Rotation" ClientHeight = 4500 ClientLeft = 1110 ClientTop = 1530 ClientWidth = 6330 LinkTopic = "Form1" PaletteMode = 1 'UseZOrder ScaleHeight = 4500 ScaleWidth = 6330 Begin VB.PictureBox picRotate Height = 4275 Left = 2220 ScaleHeight = 283 ScaleMode = 3 'Pixel ScaleWidth = 259 TabIndex = 1 Top = 120 Width = 3915 End Begin VB.PictureBox picSource AutoSize = -1 'True Height = 2430 Left = 240 Picture = "BMROTATE.frx":0000 ScaleHeight = 160 ScaleMode = 3 'Pixel ScaleWidth = 123 TabIndex = 0 Top = 300 Width = 1875 End Begin VB.Label Label1 Caption = $"BMROTATE.frx":2882 Height = 1455 Left = 240 TabIndex = 2 Top = 2880 Width = 1815 End Attribute VB_Name = "frmBMRotate" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' Copyright 1997 by Desaware Inc. All Rights Reserved Private Type POINTAPI X As Long Y As Long End Type Dim pts(2) As POINTAPI Dim currentpoint% Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, 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 Private Sub picRotate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim di& pts(currentpoint).X = X pts(currentpoint).Y = Y Select Case currentpoint Case 0 picRotate.Cls picRotate.Circle (X, Y), 2, 0 Case 1 picRotate.Circle (X, Y), 2, 0 Case 2 picRotate.Cls di = PlgBlt(picRotate.hDC, pts(0), picSource.hDC, 0, 0, picSource.ScaleWidth, picSource.ScaleHeight, 0, 0, 0) End Select currentpoint = currentpoint + 1 If currentpoint = 3 Then currentpoint = 0 End Sub