Thanks for any help that you can provide.
Declare Function TransparentBlt Lib "msimg32" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal crTransparent As Long) As Long
Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Public Type Bitmap '14 bytes
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Public Const LR_CREATEDIBSECTION = &H2000
Public Const LR_LOADFROMFILE = &H10
Sub GetDimensions()
Dim dbitmap As Bitmap
Dim hbitmap As Long
Dim filename As String
filename = Bitmap_Name
hbitmap = LoadImage(ByVal 0&, filename, 0, 0, 0, LR_LOADFROMFILE Or LR_CREATEDIBSECTION)
' Get bitmap information
GetObject hbitmap, Len(dbitmap), dbitmap
hdcHeight = dbitmap.bmHeight
hdcWidth = dbitmap.bmWidth
DeleteObject hbitmap
End Sub
Private Sub Display()
Dim TransparentColor As Long
Dim cpX, cpY 'centerpoint coordinates
picSource.Picture = LoadPicture(Bitmap_Name)
picDest.Refresh
picSource.Refresh
hdcSrc = picSource.hdc
GetDimensions
picDest.Picture = Picture2.Picture
X = 417
Y = 271
cpX = 417
cpY = 271
Xc = InputBox("What is the cFootprintX number of the graphic? ", "UAPE v1.0", 1, 600, 600)
Yc = InputBox("What is the cFootprintY number of the graphic? ", "UAPE v1.0", 1, 600, 600)
cpX = 418 - (Xc - 1) * 8 + (Yc - 1) * 8
cpY = 265 - (Xc - 1) * 4 - (Yc - 1) * 4
If Direction_String = "NW" Or Direction_String = "SE" Then
X = X - Width_Animation + Width_Animation - CP_Width + cpX - X + ((Xc - Yc) * 15)
Y = Y - Height_Animation + Height_Animation - CP_Height + cpY - Y
Else
X = X - Width_Animation + Width_Animation - CP_Width + cpX - X
Y = Y - Height_Animation + Height_Animation - CP_Height + cpY - Y
End If
TransparentColor = GetPixel(hdcSrc, 0, 0)
TransparentBlt picDest.hdc, X, Y, hdcWidth, hdcHeight, hdcSrc, 0, 0, hdcWidth, hdcHeight, TransparentColor
picDest.Refresh
End Sub
Private Sub Form_Load()
ch = CP_Height
cw = CP_Width
Xc = 0
Yc = 0
yct = 0
xct = 0
YChange = 0
XChange = 0
Form6.Show
Display
End Sub