Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Picture Resize

is there any way in VB6, to resize a photo from 600x800 pixels to fit in a picturebox or imagebox, in a size smaller the the original photo, say 200x300 pixels

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Image Or Picture Box Picture Resize
When ever you load a picture into a picture box with the stretch property to true, it will of course expand to the size of the image. Lets say I have an image 500x300pixels. I want it to fit into my image or picture box that is 250x150. Kind of like how thumb nails work. Or on windows explorer when you single click a file, it will show a smalled size of the actual image. There might be a property for this, ive just been looking at VB for so long working on a project that if its there, I dont see it. Thanks.

Picture Resize
Hello, is there a way to resize an image before storing it in a database?

I have an image control in a form (VB6) and i'm storing the selected image (using ADODB.Stream) in a MsSQL2k database. But instead of going to another application like Photo Editor to resize de picture, is it possible to do it directly from VB before storing it?



Picture Resize
is it possible to resize just some locations of a picture in a picture box ? i can't split the picture..

I started a similar thread some time ago, and someone gave me a code to stretch/shrink a BMP-file in a picturebox.
But I would really like to do this with a JPG and gif aswell (in fact any imagefile VB understands)
I cannot use the ImageBox-control because i need to draw on the picture

So if somebody could help me out with this it would be appreciated. Thank you in advance.

Resize Picture
I am trying to resize picture but it is showing error "invalid picture". this is the code

vb Code:
Private Sub Timer1_Timer()Dim ret As Longi = i + 1ret = GetDC(GetDesktopWindow)BitBlt Picture1.hDC, 0, 0, Screen.Width / 15, Screen.Height / 15, ret, _0, 0, SRCCOPYPicture1.PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeightSavePicture Picture1.Image, "C:screenshots" & "image" & i & ".jpg"End Sub

Picture Resize
I have to do a program where in a form I chose a photo and in another form I can see the photo after a resize.
but when it runs the photo is resized but picture box remain small.
what can i do?

For Resize According To Picture Box
ok i need to resize a form accoding to the size of the picture box,

i've set both scalemodes to pixel and i use this code... but it doesnt work

VB Code:
frmmain.width = frmmain.picture.scalewidthfrmmain.height = frmmain.picturescaleheight

any help?

Resize Picture?
How can i resize a bmp to 800 x 600 pixels?

Ive searched this forum for answers but cant seem find any examples that do what i want

Any help would be greatly appriciated.

Picture Resize???
I wanna know if its possible to make a form picture strech out to the size of the form. Like if I make my castles property to maximise i don't want it to have just a little picture i want it to strech with the form.

Resize Picture Box
how can i scale a picture box. im creating a screen grab program, and i get the screen shot great, but how can i set it so that when the picture box is reduced (say to 1/4 the screen size) that instead of just showing the top left quarter, it shows the whole screen, but 1/4 the size?


Resize Picture
Can I resize picture as the size of Picture Box that I have on form. I want to show whole picture in picture box.

Thanks in advance

Picture Box Resize
How can I display a picture in a picture or an image box and make the picture the largest size it can be in the box without changing its Height:width ratio?


How To Resize Picture In Vb

i want to know how to resize a picture file in Vb....
if i have a picture file in my disk and i want to resize it and to do it more less size.... can i do that in VB?

Resize That Picture!
Hi there!!!, It's me again, but this time is a simple question: how can I resize a picture???, this is what I wanna do: Open a JPG file, resize it to 13x13 pixels, and then save it as BMP... ok, anyone can help me with this?, plz!, thank you all again :-), see ya

Bye!!! Pol1
- trying to make the world graphically better -

Picture Resize
plz any one tell me how i can get the picture size and then how can i change picture size. if picture is 800*600 how can i chage it to 1024*768 and then save


I Need To Resize .bmp Picture ?
i need to resize my MDI form picture ,when i m changing my Screen Resolution eg800*600) to (1024*768) or (1024*768) to (800*600)

Thanks you for your time

sujesh mathew

Resize Picture Box
Hello friends, i really need your help. How to resize picture box include the inside pic. thx

Resize A Picture
can anybody tell me how to make an image resize to a picture box rather than the other way round, as is normally used. It's a bitmap by the way.

Resize A JPG To The Size Of My Picture Box ?
Hi guys this maybe a simple question for you but i cant seem to get it to work.

How do i resize a jpg image to the size of my picture box ?

Tnx alot !

How To Resize Image In Picture Box?

I am using picture box to view images from .bmp files. But, I dont know how to resize image size depends upon users choice, such as 75%, 100% etc.

Any help?

Yet Another Picture Resize Prob (JPG,GIF, Etc.)
Hi all,

Its 03:21AM now here in good old germany and i am very about picture and file functions with VB. I have no idea how to load a picture file and then resize it to a specific width with automatic calculation of the height, proportional to the width and then save it as JPG. Best would be, to be able to open and resize the most common picture formats like jpg, gif, bmp and eventually tiff, if possible. Is all this possible? Are there tutorials on the net or some code snippets where i can learn from? I searched the whole web including this forum but i found no solution. What to do? Pleas help!


Good Night! Will be back tomorrow! When you are sleeping!

Picture Resize And Format
hey all,
anyone know if it is possible to resize and format a picture e.g. wrap around text, after inserting it from clipart in VBA,
if so how?
cheers - Mark.

Resize Picture In A MSFlexGrid
Is it possible to resize or stretch a picture to fit a cell in a MSFlexGrid? As of now I am able to add the picture to the grid but the graphic is larger than the cell and won't shrink or resize to fit. If anyone has any ideas, I'd greatly appreicate your help. Thanks!

After BitBlt Picture Resize
ok, in my code i had just used a BitBlt to transfer one part of an image to another PictureBox. Now i am wanting to resize this picture, but moving it to yet another new, PictureBox so that it would be copied there when it was resized, didn't work. Thanks in advance.

Resize Picture (in A File)
I need to do a software that resize BMP files
For example load a 500x300 JPG and save as 100x60.
I tried loading in a stretch mode img but saving mantains the same dimensions of original file...
Thankyoufor all future answers

Resize Picture Or Text Box
Im writing a program that requires the user to be able to resize a text box and picture box, and i don't want them to have to press + and - buttons to resize it, i want them to be able to just click and drag to resize them, but i can't find a way, anyone know how???

--= Doey7 =--

Picture Within Form (Resize)
i have a big picture in my form. when form is set to maximize then whole picture is displayed inside its container (Form), but when form is restore or resized then whole picture is not displayed in form. my question is how to know that now whole picture is not displayed in the form, And how to know that now whole picture is displayed

Resize Picture - Better Resolution?

I'm using the following method to resize a picture, but I'm wondering - is there anyway I can improve the final quality of the resized picture?

With frmMain
.Picture1.Picture = LoadPicture(strImageIn)
sngEdge = .Picture1.Width - .Picture1.ScaleWidth
sngScaleDivisor = GetScaleDivisor(.Picture1.Height, .Picture1.Width)
.Picture2.Width = (.Picture1.Width - sngEdge) / sngScaleDivisor + sngEdge
.Picture2.Height = (.Picture1.Height - sngEdge) / sngScaleDivisor + sngEdge
'Resize the picture
.Picture2.AutoRedraw = True
.Picture2.PaintPicture .Picture1.Picture, _
.Picture2.ScaleLeft, .Picture2.ScaleTop, .Picture2.ScaleWidth, .Picture2.ScaleHeight, _
.Picture1.ScaleLeft, .Picture1.ScaleTop, .Picture1.ScaleWidth, .Picture1.ScaleHeight
'The only real trick is to set the result PictureBox's Picture property equal to its Image property to make the image permanent.
.Picture2.Picture = .Picture2.Image
'Save the small picture
SavePicture .Picture2.Picture, strSavePath & Format(Now(), "yymmddhhmmss") & ".bmp"
.Picture2.ToolTipText = Format(Now(), "yymmddhhmmss") & ".bmp"
End With

I suppose I want a higher DPI really, don't I?

Picture Resize Problem
i have a PictureBox in which im loading a small image on Form_Load. and later i change (Increase / Decrease Too Much) the .Height And .Width of picturebox by my code.

now i want this picture to appear in the whole picturebox with the new size of picture, how can it be reached.
pls help me

Picture Resize Problem
plz any one tell me how i can get the picture size and then how can i change picture size. if picture is 800*600 how can i chage it to 1024*768 and save.


Resize Image Box Or Picture Box?
Is there any way to load a picture(.jpg file) to picture/image box and resize it proportionally? (the scale of length/width remains the same as orginal picture)


Resize A Picture Box To Fit Text
What I want to do is load a Picture Box with text and then resize the height of the picture box to the last line that was placed into the picture box (dynamic).

The program loads a page (10 lines) of text into a picture box. I do not care about the screen resolution or the font size the user has. I just want to resize the box to fix the text (height only, not width, it is ok).

or make the ten lines fill the whole picture box (of course dynamically).

How would I do this, best.

How To Resize A Picture In Word
thank you
and I finally remember that it was possible to select object with the cursor keys when not possible with mouse !!

Picture - Proportional Resize
I'm creating an interface to view a picture collection. I'd like to display each picture completely on my form. Some pics are larger than the screen, so I need to resize those to a size smaller than the original. I want the height and width to be in correct proportion to the original to prevent any skewing. What's the best way to go about this?

Resize The Picture In The Form
I would like to resize the picture in a form as the resolution of the screen is changed.The picture is added using the picture property.I have already downloaded the Resize ocx.But it gets affected only for the controls inside the form

Anyone pls help me.

MDIForm.Picture Resize
I have a MDIForm, and i put a picture in as a background. The MDIForm.Picture.Width and MDIForm.Picture.Height doesnt NOT work, is there another way to resize the form at the same time the user does it?

Background Picture Resize
If I use the Picture property of the form, I can specify it to put a bitmap on the form as the background.

Is there any way that I can resize the picture to adjust to the form size?


Picture Box Cut Off/resize Problem
I have a problem with picture boxes in my program.
On some other user's computers the pictures are scaled bigger and cut off by the original frame of the picture box, but when i test them on my computer they show up correctly.

Does anybody know that problem and a solution for it?
If this has already been asked, could you give me a link, please?

Resize Picture Box Image VB 6
Basically I have a picture box that I have used SetPixelV to make the image and I need to stretch the image in to a picture box, which is 1200 high, and 1200 wide.

I played around with a few source codes I have found around like this one below which works fine if you use Picture1.PaintPicture Picture1.Picture but I need to use some think like Picture1.PaintPicture Picture1.image, any ideas?

  Picture1.ScaleMode = 3
    Picture1.AutoRedraw = True
    Picture1.PaintPicture Picture1.Picture, _
        0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, _
        0, 0, _
        Picture1.Picture.Width / 26.46, _
        Picture1.Picture.Height / 26.46
    Picture1 = Picture1.Image

Edited by - Alcoholic1 on 2/5/2006 1:36:03 AM

How To Resize Pictures In Picture Box?
I have a picture box of size 500x500.Then i want to put a picture of size 800x800 in the picture box with out increasing the size of the picture box.That means how to resize the picture in the picture box without adjusting the picturebox size?
those who know this please let me know


Resize Image In Picture Box
i search this fourm but cannot find help about this but cannot find

i use two picture box and one image box. putting image in first picture box from a Data Base and make it transparent the image is 200x120 which is show in picture box .

i need a thumbnail of that image in Picture box 2 but the image width is same in picture box 2
what i need is to resize that image shown in Picture Box 1 and
and show it in Picture box 2

i use imageBox but i dont know how i make picture transparent in
Image Box

thanks if anyone help me

Resize Images In Picture Box
I wish to put more than image in a picture box...and all image in the picture box are able to resize using mouse... do anyone got any idea for me to do this? please help!


Howto Resize Picture With Same Ratio's?
I'm have a bit of trouble with a very simpe problem(I think).

I want to resize a picture and center a picture with the same ratio's. So lets say I have a picturebox wich represents 720 pixel in width and 576 in height. I load a picture in anothre picturebox wich has his autosize set to true. Let's say this picture is 300 x 400 pixels. How do I center this picture in the first picture box conserving it's ratio's? I don't want it to stretch. Just to center with paintpicture keeping the ratio's with the first picturebox. I have this code sofar...buth it's not working out as I planned it. The ratio's are distorted...

'Picbox is the destination Picturebox

Dim TmpPic As StdPicture
Dim AspectRatio As Single
Dim ScalingX As Single
Dim ScalingY As Single

Set TmpPic = Picturebox2.Picture 'Picturebox2 has autosize set to true

ScalingX = ((720 * 15) / TmpPic.Width) '720x15 to get the twipsize
ScalingY = ((576 * 15) / TmpPic.Height)
PicBox.PaintPicture TmpPic, (PicBox.Width - (PicBox.Width / ScalingX)) / 2, (PicBox.Height - (PicBox.Height / ScalingY)) / 2, PicBox.Width / ScalingX, PicBox.Height / ScalingY

If any one has any idea's...please...

Auto Resize Picture After Insert
I created a macro to insert picture and after insert the picture will auto resize and fit into my range (BO1).
Please advice

Dim x As Variant

x = Application.GetOpenFilename("Pictures (*.jpg;*.bmp;*.gif), *.jpg;*.bmp", , "Select Picture")
If x = False Then Exit Sub 'no file selected
Set mypic = ActiveSheet.Pictures.Insert(x)
With mypic
.Left = Range("BO1").Left
.Top = Range("BO1").Top

End With

Resize Picture Not Bigger Than Screen
hi all
im trying to load my picture up and resize the picture so that it is not bigger than the screen i have tryed a couple of things with no look any help on this would be great

With Me
.ScaleMode = vbPixels
End With

'Set up picturebox
With pic
.ScaleMode = vbPixels
.AutoRedraw = True
.AutoSize = True
.DrawMode = vbInvert
.DrawStyle = vbDashDot

.MousePointer = vbCrosshair
.Picture = LoadPicture("C: emp.jpg")
End With

Resize Picture On Command Button
I have an .ico file which I want to display on command button.
Now the size of the ico is slightly big, which I would like to reduce. It does not open in Paint, please suggest if there is an alternative.


How To Select And Resize A Picture Box At Run Time?

iam trying to create a legend for my own chart control.

i am putting one label and one option button in the picure box.

i made both label and option button indexes are zero so that i can dynamically load the controls to any number.

after that depending on the number of curves plotted that many number of labels and option buttons will be loaded.

now the problem is the picture box is growing height wise and iam not able to restrict the height of the picture box.

now i want to select that picture box make it resize to any size.

please provide me the solution..


Automatic Picture Resize/paste/bluebox
hi there,

i've posted this in another forum and noone seems to want to help, or either are unable. i have no idea, anyhow, after a cars accident, i need to get this app done...

i'll copy/paste my post from the other forum:


i'm programming (trying at least) a programm with Microsofts Visual Basic 2005 Express that should do the following:

- load a main picture which either has a transparent box in it somewhere or the user can define the 4 main (edge) coordinates of this box where

- a second picture gets glued into (merged or overlayed) getting the transparent boxed size (being automatically resized to fit perfectly) and

- the final result gets to be saved on disk.

anyhow, i can load the pictures. merge them together but the final picture is a mess. both pictures are then on the upper left corner of the image box (coordinated possibly on pixel 0/0)

that final result can be saved as well...

and here the questions:

is it possible to use the standard VB codes to let the programm find that transparent box automatically? (speed is of no importance at all)

better yet, if that transparent area isn't exactly a box (rectangle of whatever) but a flat cylinder, that the second picture just fills out the complete area (stretching i guess would be appropiate).

it would be ideally if the user would have the possibility to give the programm the 4 edges of a box in an image which has no transparent area so that picture also can be emerged (by clicking with the mouse)

how could i (or any beginner) achieve something like this?

it would be great, if anyone could help me on this...

thanks in advance

p.s. i think i've posted into the wrong subforum... if so... please move this. thanks

Help! How To Resize Picture's Content With The Form Size?
Does anyone can help me with this?
I was trying to write some text line to a form and display on screen. They are different in font sizes. However, when I resize the form, none of the printed text will not resize in proportion with the form size.

So this is not what I want. Then I put a picturebox into the form. And I wrote text into that picturebox1. The texts did appear in that Form1.picturebox1. Yet, when I resize it, the picturebox will not resize with the form.

Then I also try some like this:
Sub displayWord_onForm()
Form1.Picture1.FontSize = 26
Form1.Picture1.Print "Super!!"
' Clear the Clipboard if it's another type of data in the Clipboard.
Clipboard.SetData Form1.Picture1.Picture
' Copy Clipboard text to Text2.
frmdisplay.Picture1.Picture = Clipboard.GetData
End Sub

Guess what? nothing appears on the form frmdisplay.

Can anyone tell me how to deal with this?
I would really appreciate.


Copyright 2005-08, All rights reserved