|
-
Oct 20th, 2011, 11:06 AM
#1
Thread Starter
Lively Member
Rotate image in image box
Hi all,
Is there any technique or idea to rotate an image in image box.
I see many sample code to rotate image in a picture box, but I want to do the same using image box, is it possible ?
Pls help
-
Oct 20th, 2011, 11:40 AM
#2
Re: Rotate image in image box
Yes and no. The real answer is no.
What you can do is rotate the image using various techniques you've found while searching -- whether it be rotating to a hidden picturebox or offscreen memory DC. Then assign the image control the handle of the rotated image.
1. If rotating to a hidden picturebox, I am assuming your examples draw the rotated image to the picturebox vs. reassigning a handle...
-- ensure AutoRedraw is True for picbox & sized appropriately for rotation
-- set the image handle to the picbox image. Set imgbox.Picture = picbox.Image
2. If rotating to a memory dc, you'll need to use APIs to convert the rotated bitmap handle to a stdPicture handle. Search forum for examples, using keyword: OleCreatePictureIndirect
Also note that your image control will not contain transparency unless you convert the rotated bitmap to a transparent GIF or Icon format.
You might want to search about using key terms: rotate transparent gif
My Alpha Image Control project may be more than you are looking for, but you might want to play with that also. See the link in my signature below
Last edited by LaVolpe; Oct 20th, 2011 at 11:53 AM.
-
Oct 20th, 2011, 12:30 PM
#3
Thread Starter
Lively Member
Re: Rotate image in image box
Hi LaVolpe,
Thanks for your prompt replay.
The problem of picture box, it reduces the image clarity and neatness. I have already tested using a hidden picture box but it effects the image clarity negatively and the image become vulgar in the picture box.
And in my project there is option for zoom in and out. This time the image become more vulgar and in bad condition in a picture box.
But the image box keeps the clarity and we can zoom it without any problem to the image in it.
So I want to rotate an image keeping its clarity and neatness.
Can you please suggest any idea ?
Regards,
Nasreen
-
Oct 20th, 2011, 12:39 PM
#4
Re: Rotate image in image box
Zooming with VB can produce poor results, especially zooming out to larger scales. This is because VB uses a scaling interpolation model of nearest neighbor. This is a very fast & simple model, but not necessarily the cleanest. Other models can be used that produce a soft blur around the rotated edges that remove jaggies. Two of those other models are known as bicubic & bilinear. Neither are supported by VB6 directly.
If you are getting poor results when zooming compared to an image control with stretch property set to true, then I'd suggest that the problem lies in the rotation function you are using.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|