Visual Basic/Very Ungent help Required
Expert: Robert Nunemaker - 1/8/2009
QuestionHi Frnds,
I have a immediate requirement for one of my client. the requirement is the jpeg images are loaded in the vb6 application dynamically depending upon the selection. the user should be able to resize the image as the user just drags. the same should be able to save. Can anyone please help me out.
Thanks
Ravishankar
AnswerYou could do this with a LOT of work with an Image or Picture control. However, there are ActiveX controls out there that would have this functionality built in that would save you a lot of work on this. I don't have time to list them all, but one that I've seen is found at:
http://www.softsia.com/GOGO-Picture-Viewer-ActiveX-SDK-download-rhg1.htm
If you wanted to do it yourself, you'd use an Image or Picture control. Then set the Picture property with the LoadPicture method to the picture of choice. THEN, compare the height/width of the picture to the control and if larger, expand the control, but only to the max size you want (i.e. no larger than the containing control or form). You'd also want to do the same if it's smaller than the control. THEN, you'd need something control the MouseOver event to change the cursor, and then MouseDown to capture the drag coordinates. Then finally MouseUp to resize everything as they requested.
As you can see, a lot of work that you shouldn't be concerned with because someone else has done it for you already and gives other functionality besides.
Hope this helps.