There are literally hundreds of examples of rotating a bitmap in VB on the web. A quick search on Google or similar should find them. Most work by calculating the necessary mathematical transform, and then applying that transform pixel by pixel against the source image to generate the target image.
In the case of a jpg, you would need to LoadPicture to get a bitmap, do the transform - then find a free jpg library to save the image as a jpg. One that I happen to have liked in the past is available here:
One solution that ought to work (in NT/200/XP) uses the SetWorldTransform api call - but I've never got the call to work successfully from VB. If it did work it would mean that you could set up the required transform in one call, and then apply that transform with a single bitblt.
It is theoretically impossible to rotate a .jpg through an arbritary angle without losing quality
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
Why not convert the jpg to a bitmap, rotate, then convert back? he he he No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.