|
-
Aug 2nd, 2000, 07:14 PM
#1
Thread Starter
Lively Member
OK fellers, here's an easy question for you. I'm writing a little app at the moment, a small part of which requires the user to load a graphic. However, I would like them to be able to preview the graphic before loading it into the application, by displaying what is effectively a little preview thumbnail. I suspect it may be along the lines of loading the image when they select it and then resizing it and displaying it into a small image box. Is there an easy way, perhaps using BITBLT or whatever, to resize such an image? My worry is that there is NOT an easy way. I'm not too familiar with BITBLT, though I have used it briefly before, so if anybody does provide me with some code, comments would be massively appreciated. Thanks in advance!
SamDV
-
Aug 2nd, 2000, 07:28 PM
#2
_______
<?>
just load it into a smaller size image control
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 2nd, 2000, 07:30 PM
#3
_______
<?>
you have to set the stretch property of the image control to true
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 2nd, 2000, 07:33 PM
#4
BltBlt cannot resize images. The API method for that is StretchBlt. In this example, I will use PaintPicture because it's the easiest.
Put this in a form with a CommonDialog, PictureBox and CommandButton
Code:
Private Sub Command1_Click()
CommonDialog1.ShowOpen
Picture1.PaintPicture LoadPicture(CommonDialog1.filename), _
0, 0, Picture1.Width, Picture1.Height
End Sub
Please note that for simplicity sake, I did not include any Error Handling.
-
Aug 2nd, 2000, 07:58 PM
#5
Thread Starter
Lively Member
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
|