How to scale the size of a .BMP picture?

How to scale the size of a .BMP picture?

Post by spla » Sun, 08 Nov 1998 04:00:00



Hello Everyone:

        I want to check the size of a bitmap picture before loading it into a
Picture control or Image control.  If the size of a bitmap is bigger than e.g.

500kB or 120x120, I want the control to scale the picture into 120x120 and
save the scaled picture into a file e.g. ABC.bmp.

Can anyone please tell me how to do the following:

1)  How to detect the size of a picture file in kB or in HeightxWidth?

2)  How to scale the picture into the required dimension e.g. 120x120?

3)  Can the SavePicture( ) save the scaled picture?  

        I try to scale a picture in Image control with Stretch = True, and
save the image with SavePicture( ).  But the new picture remains in the same
size!

Can anyone give me some advise, suggestion or example please?

Thanks in advance!

 
 
 

How to scale the size of a .BMP picture?

Post by Huy Hoan » Sun, 08 Nov 1998 04:00:00


Try the following

Picture1.image.height = blah blah

splau heeft geschreven in bericht

Quote:>Hello Everyone:

>        I want to check the size of a bitmap picture before loading it into
a
>Picture control or Image control.  If the size of a bitmap is bigger than
e.g.

>500kB or 120x120, I want the control to scale the picture into 120x120 and
>save the scaled picture into a file e.g. ABC.bmp.

>Can anyone please tell me how to do the following:

>1)  How to detect the size of a picture file in kB or in HeightxWidth?

>2)  How to scale the picture into the required dimension e.g. 120x120?

>3)  Can the SavePicture( ) save the scaled picture?

>        I try to scale a picture in Image control with Stretch = True, and
>save the image with SavePicture( ).  But the new picture remains in the
same
>size!

>Can anyone give me some advise, suggestion or example please?

>Thanks in advance!


 
 
 

How to scale the size of a .BMP picture?

Post by Mike William » Sun, 08 Nov 1998 04:00:00


You can find out the size (in pixels) like this:

Dim p1 As Picture, picwide As Integer, pichigh As Integer
Set p1 = LoadPicture("c:\mypic.gif")
picwide = ScaleX(p1.Width, vbHimetric, vbPixels)
pichigh = ScaleY(p1.Height, vbHimetric, vbPixels)
Print picwide; " x "; pichigh


>Hello Everyone:

>        I want to check the size of a bitmap picture before loading it into
a
>Picture control or Image control
>snip<

 
 
 

How to scale the size of a .BMP picture?

Post by omegatechw.. » Sun, 08 Nov 1998 04:00:00



decided to enlighten us with :

Quote:>Hello Everyone:

>        I want to check the size of a bitmap picture before loading it into a
>Picture control or Image control.  If the size of a bitmap is bigger than e.g.

>500kB or 120x120, I want the control to scale the picture into 120x120 and
>save the scaled picture into a file e.g. ABC.bmp.

>Can anyone please tell me how to do the following:

>1)  How to detect the size of a picture file in kB or in HeightxWidth?

>2)  How to scale the picture into the required dimension e.g. 120x120?

>3)  Can the SavePicture( ) save the scaled picture?  

>        I try to scale a picture in Image control with Stretch = True, and
>save the image with SavePicture( ).  But the new picture remains in the same
>size!

>Can anyone give me some advise, suggestion or example please?

>Thanks in advance!

Number 1 has been taken care of already.

Have a look into the StretchBlt function. Once you've succeeded in
blitting the image to another control at another scale, you can use
SavePicture to save the scaled image, as long as the destination
control supports the SavePicture method.

        Good luck,
        Jeremiah D. Seitz
        Omega Techware
        Solutions for small businesses
        http://members.home.net/omegatechware

 
 
 

How to scale the size of a .BMP picture?

Post by CyberAce » Mon, 09 Nov 1998 04:00:00


What you could do is using two pictureboxes. One is hidden and is used to
load the picture, the other one is visible and receives the picture by using
the PaintPicture method to copy from the hidden box. PaintPicture can shrink
and stretch as desired.

Be aware, though, that sometimes you have to use PaintPicture
HiddenBox.Picture and sometimes PaintPicture HiddenBox.IMAGE (don't want to
dive into the reasons now).

John Tegelaar


>Hello Everyone:

>        I want to check the size of a bitmap picture before loading it into
a
>Picture control or Image control.  If the size of a bitmap is bigger than
e.g.

>500kB or 120x120, I want the control to scale the picture into 120x120 and
>save the scaled picture into a file e.g. ABC.bmp.

>Can anyone please tell me how to do the following:

>1)  How to detect the size of a picture file in kB or in HeightxWidth?

>2)  How to scale the picture into the required dimension e.g. 120x120?

>3)  Can the SavePicture( ) save the scaled picture?

<SNIP>
 
 
 

1. How to scale the size of a .BMP picture and save it with SavePicture()?

Hello Everyone:

        I want to check the size of a bitmap picture before loading it into a
Picture control or Image control.  If the size of a bitmap is bigger than e.g.
500kB or 120x120, I want the control to scale the picture into 120x120 and
save the scaled picture into a file e.g. ABC.bmp.

Can anyone please tell me how to do the following:

1)  How to detect the size of a picture file in kB or in HeightxWidth?

2)  How to scale the picture into the required dimension e.g. 120x120?

3)  Can the SavePicture( ) save the scaled picture?  

        I try to scale a picture in Image control with Stretch = True, and
save the image with SavePicture( ).  But the new picture remains in the same
size!

Can anyone give me some advise, suggestion or example please?

Thanks in advance!

2. !#@!![?] Insanely huge number error

3. Insert full size BMP picture

4. Get Server Name for a DSN

5. print and retrive the BMP Picture in the Text File

6. Print Setup in a Foundational Read

7. HELP - Print BMP pictures

8. Online and power-failure/esql-C errors

9. Centering bmp in picture box

10. Crystal Reports/ Pictures (BMP, etc)

11. HELP: Store picture /BMP in Access Database

12. Store Picture /BMP into MDB without using data bound

13. BMP into picture box ?