well, lol, I kinda messed up the code and now it doesnt work at all..... I basically copied the code from Proporskis VB Blinkenlights app, and modified it some. I'm sure I'm making this way too complicated. This codes does not work (at least I dont think it does, I'm at work right now, lol) If it did work, it worked with a 36wx9h image at position 5,5:
Code:
Public Sub DrawBMPXY(hPic As Long, x As Integer, y As Integer, height As Integer, width As Integer)
Dim iData As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim intCtr As Integer
Dim intStartRow As Integer
Dim intEndRow As Integer
Dim intYOffset As Integer
Dim intYStart As Integer
Dim intYEnd As Integer
For i = 0 To 7
If (8 * i) > y Then
intStartRow = i - 1
Exit For
End If
Next i
For i = 7 To 0 Step -1
If (8 * i) < (y + height) Then
intEndRow = i
Exit For
End If
Next i
intYOffset = 0
For i = intStartRow To intEndRow '0-7 = 8 Display Rows
'Change Write Position - X
Call ChangeWritePositionX(x)
'Change Write Position - Y
Call ChangeWritePositionY(i)
For j = x To (x + width) - 1
iData = 0
If i = intStartRow Then
intYStart = (8 * (intStartRow)) + y
Else
intYStart = 1
End If
If i = intEndRow Then
intYEnd = (y + height) - (8 * intEndRow) - 1
Else
intYEnd = 8
End If
'Code that tries to draw any size bitmap to any location
For k = 1 To 8
If (k >= intYStart) And (k <= intYEnd) Then
'Debug.Print (j - x) + 1 & ", " & (i * 8 + k - (intYStart - 1) - intYOffset) & ": " & GetPixel(hPic, (j - x) , i * 8 + (k-1) - (intYStart - 1))
If GetPixel(hPic, (j - x) , (i * 8 + (k-1) - (intYStart - 1) - intYOffset)) = 0 Then
iData = iData + 2 ^ (k - 1)
End If
End If
Next k
'Code to draw a 128x64 file
'For k = 1 To 8
' If iData And (2 ^ (k - 1)) Then
' picTmp.PSet ((j - x) + 1, (i * 8 + k - (intYStart - 1) - intYOffset)), vbBlack
' End If
'Next
WriteData iData
Next j
intYOffset = intYOffset + (intYStart - 1)
Next i
End Sub
Using code similar to the above, I was able to draw an image at any x position, but when y was greater than 7, it would fail.