You have to use the actual height along with the srcY for partial renderring
Using pixels for example. Let's say the image was 300 pixels in height and you wanted to render 200 of the 300
SrcY = ActualHeight - SrcY i.e., SrcY = 300 - 200
I see you have this in a class and are manually converting to/from himetrics. But I'll use ScaleX & ScaleY for easier reading & assume all the parameters are passed in pixels.
To prevent unexpected consequences, I'd recommend validating passed source parameters at a minimum & also ensure destination parameters are within reason. Maybe one of the following proves invalid?Code:.Render (hDC), destX, destY, destWidth, destHeight, _ srcX, .Height - ScaleY(SrcY, vbPixels, vbHimetric), SrcWidth, -SrcHeight, ByVal 0&
- SrcY + SrcHeight cannot be less than 0 and cannot be > ActualHeight
- SrcX + SrcWidth cannot be less than 0 and cannot be > ActualWidth
- SrcHeight & SrcWidth must be between 0 and actual dimensions




Reply With Quote