How to stretch image? 
Author Message
 How to stretch image?
Check out this link..

http://www.*-*-*.com/


Quote:
>Dear all, I'm trying to save an image to a file resized. Say, I have a
>300x500 pixel jpg and I want to convert and save it to a 1024x768 bmp. I
>tried the following code but it will just give me a grey bmp file with
>nothing at all. How come? The SourceFile and DestinationFile values are
>tested with Dir() and ARE valid.

>Please help...

>            Dim lngWidth, lngHeight
>            lngWidth = Screen.Width
>            lngHeight = Screen.Height
>            Set Picture1.Picture = LoadPicture(SourceFile)
>            Picture3.Width = lngWidth
>            Picture3.Height = lngHeight
>            Picture3.PaintPicture Picture1.Picture, 0, 0, lngWidth,
>lngHeight
>            Picture4.Width = lngWidth
>            Picture4.Height = lngHeight
>            Picture4.Picture = Picture3.Image
>            SavePicture Picture4.Picture, DestinationFile

>Thanks,
>            Jules

>***24 hours in a day...24 beers in a case...coincidence?***




Wed, 22 Aug 2001 03:00:00 GMT  
 How to stretch image?
You have to change the 'AutoRedraw' property of the picture boxes to 'True'.
Then it works fine!

Best Wishes,
Jesse Olson


Quote:
>Dear all, I'm trying to save an image to a file resized. Say, I have a
>300x500 pixel jpg and I want to convert and save it to a 1024x768 bmp. I
>tried the following code but it will just give me a grey bmp file with
>nothing at all. How come? The SourceFile and DestinationFile values are
>tested with Dir() and ARE valid.

>Please help...

>            Dim lngWidth, lngHeight
>            lngWidth = Screen.Width
>            lngHeight = Screen.Height
>            Set Picture1.Picture = LoadPicture(SourceFile)
>            Picture3.Width = lngWidth
>            Picture3.Height = lngHeight
>            Picture3.PaintPicture Picture1.Picture, 0, 0, lngWidth,
>lngHeight
>            Picture4.Width = lngWidth
>            Picture4.Height = lngHeight
>            Picture4.Picture = Picture3.Image
>            SavePicture Picture4.Picture, DestinationFile

>Thanks,
>            Jules

>***24 hours in a day...24 beers in a case...coincidence?***



Wed, 22 Aug 2001 03:00:00 GMT  
 How to stretch image?
Dear all, I'm trying to save an image to a file resized. Say, I have a
300x500 pixel jpg and I want to convert and save it to a 1024x768 bmp. I
tried the following code but it will just give me a grey bmp file with
nothing at all. How come? The SourceFile and DestinationFile values are
tested with Dir() and ARE valid.

Please help...

            Dim lngWidth, lngHeight
            lngWidth = Screen.Width
            lngHeight = Screen.Height
            Set Picture1.Picture = LoadPicture(SourceFile)
            Picture3.Width = lngWidth
            Picture3.Height = lngHeight
            Picture3.PaintPicture Picture1.Picture, 0, 0, lngWidth,
lngHeight
            Picture4.Width = lngWidth
            Picture4.Height = lngHeight
            Picture4.Picture = Picture3.Image
            SavePicture Picture4.Picture, DestinationFile

Thanks,
            Jules

***24 hours in a day...24 beers in a case...coincidence?***



Thu, 23 Aug 2001 03:00:00 GMT  
 How to stretch image?
Before you try to save , what does Picture3 look like?

If it looks OK, then try :
SavePicture Picture3.Image, DestinationFile



Thu, 23 Aug 2001 03:00:00 GMT  
 How to stretch image?

Gary try this

SavePicture Picture4.Image  as opposed to (SavePicture Picture4.Picture)



Thu, 23 Aug 2001 03:00:00 GMT  
 How to stretch image?
hi julius,
         Maybe you could use the StretchBlt function which copies a bitmap
from a source rectangle into a destination rectangle, stretching or
compressing the bitmap to fit the dimensions of the destination rectangle,
if necessary. The system stretches or compresses the bitmap according to the
stretching mode currently set in the destination device context.You can
check the MSDN for more infomation.
naveen
Quote:

> Dear all, I'm trying to save an image to a file resized. Say, I have a
> 300x500 pixel jpg and I want to convert and save it to a 1024x768 bmp. I
> tried the following code but it will just give me a grey bmp file with
> nothing at all. How come? The SourceFile and DestinationFile values are
> tested with Dir() and ARE valid.

> Please help...

>             Dim lngWidth, lngHeight
>             lngWidth = Screen.Width
>             lngHeight = Screen.Height
>             Set Picture1.Picture = LoadPicture(SourceFile)
>             Picture3.Width = lngWidth
>             Picture3.Height = lngHeight
>             Picture3.PaintPicture Picture1.Picture, 0, 0, lngWidth,
> lngHeight
>             Picture4.Width = lngWidth
>             Picture4.Height = lngHeight
>             Picture4.Picture = Picture3.Image
>             SavePicture Picture4.Picture, DestinationFile

> Thanks,
>             Jules

> ***24 hours in a day...24 beers in a case...coincidence?***



Thu, 23 Aug 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Apply a stretched image as a listview background

2. How to Resize/Stretch images in an ImageList

3. How to stretch image?

4. Copying a stretched image to picture box

5. How to stretch image?

6. How to stretch image?

7. Copying a stretched image to picture box

8. Shrink or Stretch image in picture box but keep image in poportion?

9. Saving image stretch results?

10. auto stretch a image in picturebox to a correct ratio

11. Stretched Image on PictureBox?

12. Strange Distortion of Image with Stretch = True

 

 
Powered by phpBB® Forum Software