|
-
Jun 1st, 2000, 03:58 AM
#1
Thread Starter
New Member
Is there a routine or call to resize images on a form or do
I have to do the math myself? In case this isn't clear,
setting the stretch property to TRUE deforms the image.
I want to resize it to the size of my image box yet keep
the right proportions.
-
Jun 5th, 2000, 02:38 AM
#2
Monday Morning Lunatic
well, you could try setting something up like this:
Code:
Dim gfAspect as Single
Private Sub Form_Load()
gfAspect = (4 / 3) ' Screen proportions
End Sub
Private Sub MyResizer(fWidth as Single)
imgThePicture.Width = CLng(fWidth)
imgThePicture.Height = CLng(fWidth * (1 / gfAspect))
End Sub
I think that should work, but I'm not sure what you want though. If you just want to neatly stretch an Image control, then you can set the aspect, then alter the width and the height will sort itself out!
-
Jun 5th, 2000, 11:06 PM
#3
Thread Starter
New Member
Thanks for replying. Shortly after I posted this, I went
ahead and did the math myself, doing something similar to
what you suggested. My dilema now is that changing the size
of the image and then saving it doesn't actually change
the dimensions of the saved image. I tried both with a
picture box and an image to a picture box. If I pop a msgbox
with the height and width of the image, it reflects the
modified size. But as soon as I save it, the size is back
to its original size. Any ideas?
-
Jun 5th, 2000, 11:13 PM
#4
PowerPoster
Save it's Image:
Code:
SavePicture Picture1.Image FileName
-
Jun 6th, 2000, 02:33 AM
#5
Code:
SavePicture Picture1.Picture, "C:\MyFileName.bmp"
-
Jun 6th, 2000, 02:50 AM
#6
PowerPoster
Megatron, I think that's wrong...
-
Jun 7th, 2000, 01:03 AM
#7
Thread Starter
New Member
Tried that. It saves the same picture that loaded in
LoadPicture regardless of how I change the dimensions.
I also tried loading it into an image, changing dimensions,
then sticking it in an imagebox and saving it. Same deal.
-
Jun 8th, 2000, 03:36 AM
#8
Monday Morning Lunatic
saving it in that way doesn't change the image data, only the way it's displayed. you'll need to store the larger bitmap yourself, then paint it onto the picturebox, and save to a bmp.
-
Jun 8th, 2000, 03:49 AM
#9
PowerPoster
In fact if you stretch the picture with StretchBlt you can store it's image...
-
Jun 9th, 2000, 02:07 AM
#10
No, Fox, it's right, trust me.
-
Jun 9th, 2000, 04:17 AM
#11
PowerPoster
But you don't save the stretched or redrawn picture then... just the one you loaded into the box.
-
Jun 10th, 2000, 08:00 AM
#12
transcendental analytic
Fox is right meg, image is the persistent graphics, the output of a graphics method.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 10th, 2000, 09:32 PM
#13
Hold on, let me try it...
Yeah, it does. I guess you were right!
-
Jun 10th, 2000, 10:41 PM
#14
-
Jun 11th, 2000, 02:28 AM
#15
transcendental analytic
Hehe
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 11th, 2000, 03:42 AM
#16
What's with the one word replies?
-
Jun 12th, 2000, 04:08 AM
#17
Monday Morning Lunatic
-
Nov 22nd, 2000, 11:02 AM
#18
-
Nov 22nd, 2000, 05:46 PM
#19
Monday Morning Lunatic
Yeah.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 23rd, 2000, 02:46 PM
#20
whooaa
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
|