Without having to download it, the backcolor doesnt change cause all 3 cases must pass in your If statement. So lets say the backcolor is black which is 0 0 0. Lets just let X and Y be just one pixel, at (0, 0). If ImageDataChanged(0 + 2, 0) is not equal to clrBackColor.Red And so on and so forth for Green and Blue, it won't change.
Also for rotation, be sure you are using radians and not degrees, and also be sure you are doing it from the center of the image when something like this:
Well in this case I'm doing it as vertices. But I do have some old code to literally "Perspective Correct Texture Map" an image regardless of angle correctly, or you'll end up with cracks and holes. This scanlines the image from top to bottom. Unfortunately its in 3D in pure VB, but if you remove the Z's it'll still work in 2D for 2D rotation:
joaquim
The procedure DrawImageData, when you call StretchDIBits bmi structure contains options of ImageData array, but must ImageDataChanged.
thanks. i found that error and more. that's why some properties results wasn't corrects lol.
thanks for the help my friend.
but what you can tell me about the rotation effect?
(if the rotate property is 0(zero), the image is showed normaly. and the other effects works normaly too. but what isn't right with our rotate effect?)
heres the class updated... but with rotate problem
only, when, rotate diferent 0(zero), the bad results are showed. if the rotate is 0(zero), the image is showed normaly
If lngRotate <> 0 Then
RC = InvRotateCoord(X, Y, lngWidthImage / (3 * bmi.bmHeader.bmBitCount) / 2, lngHeigthImage / 2, lngRotate)
If RC.RotatedX < 0 Or RC.RotatedX >= bm.bmWidth Or RC.RotatedY < 0 Or RC.RotatedY >= bm.bmHeight Then
'do nothing
Else
ImageDataChanged(X + 2, Y) = ImageData(RC.RotatedX / (3 * bmi.bmHeader.bmBitCount) + 2, RC.RotatedY)
ImageDataChanged(X + 1, Y) = ImageData(RC.RotatedX / (3 * bmi.bmHeader.bmBitCount) + 1, RC.RotatedY)
ImageDataChanged(X, Y) = ImageData(RC.RotatedX / (3 * bmi.bmHeader.bmBitCount), RC.RotatedY)
End If
Code:
Private Function ByteAlignOnWord(ByVal bitDepth As Byte, ByVal Width As Long) As Long
' function to align any bit depth on dWord boundaries
ByteAlignOnWord = (((Width * bitDepth) + &H1F&) And Not &H1F&) \ &H8&
End Function
because i know that x limite isByteAlignOnWord(bmi.bmHeader.bmBitCount, lngWidthImage), i must found X0(center of X) and then convert it, i belive. that's why i have the bad results. any advices for fix these problem?