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




How Can I Change The Image Size


I drawed lots of regions and line inside of a picturebox using API. (around 150 regions filled by different kind of brush)

I wonder how can I change their size when i resize the picturebox. I try cls and draw again, the effect is not smooth as all the data are read from database.

Any good method?

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Change An Image Size?
Hi again...
I would like to know if there is a way to load a picture on a pictureBox and to make this picture the appropiate size as to fit on the pictureBox control dimensions...

Hope someone can help...

How To Change The Size Of Image Runtime
Hi, In my application i am using image box to display picture which is scanned from scanner & stored in bmp. Whenever i am displaying picture it diplays in its full size i.e. height 9900 & width 16200. I want to display the full image in the size height 6600 width 12000. I am changing the dimensions of image after loading but it is not changing can you help me.

Paint Vs Image To Change Size Of Photo
How do I change the size of an image, photo?
Some email attachment of photos are too big, they need to be smaller (100k max)
1. Load photo (bmp, jpg) into Image or Paint object.
Private Sub Form_Load()
Image1.??
Picture1.Picture ?? load (c:xxx.)
End Sub
2. Change size of Object using "Stretch" / while checking size of Photo.
...still looking for this code

3. Save photo
The other part is sending the new email....whole another thread

Thanks

Ok, How The Heck Do I Change The Image Size In ImageList?
The buttons on my toolbar are too big, this is caused by the images in the ImageList.

But everytime I want to change the image size in the ImageList, it gives me an error "Property is read-only if image list contains images." DOH! What's an ImageList for if it doesn't contain images???

Can anyone help me out? Thanks a lot in advance.

To Change The Size Of Image Viewed In Picturebox
here is my code to loop through images found
in a directory,

For iX = LBound(pics()) To UBound(pics())
Set Picture1 = LoadPicture(pics(iX))
Sleep (lTime)
Next

i am trying to get the image, if it is too large
to fit in the picture box, to reduce in size to
fit without becoming distorted, perhaps even being
centered within the picture box.

i have toyed with the width and height properties,
but can't seem to get it correct.

can someone help,
larryn

PictureBox Size Change With Form Size [Solved]
I have a toolbar and a statusbar on my form, i want the size of the picturebox to follow the size of the form. So this is my code

Code:
Private Sub Form_Resize()


If Me.WindowState <> 1 Then 'not minimized
    On Error Resume Next
    
    
    Picture1.Top = Toolbar1.Top + Toolbar1.Height
    
    Picture1.Left = 0
    
    Picture1.Width = StatusBar1.Width
    
    Picture1.Height = StatusBar1.Top - (Toolbar1.Top + Toolbar1.Height)
    
        
End If

End Sub



This works perfect if the window state is 0 (normal) if it is maximized the size of the picturebox is the same as it was before i maximized.

Below is the testcode



Edited by - anders@dac.se on 6/16/2004 6:37:13 AM

Form Size Change With Screen Size
Hi

I Want Change My Form Size On Different Resolution ( 800*600, 1024 *768 )
Please Help

Popupmenu Background Color Change As Well As Font Size Change
hi folks
am creating one popupmenu using createpopupmenu() API
and also i insert items dynamically using insertmenuitem API
and display using Trackpopupmenu().
My problem is

1)i want to change the background color of popup menu?????
2 i want to change the font size in popup menu ???????
dynamically .
if any body know API or how to change the font size and change the background color in popupmenu ,please help ur friend.

Important:
I don't need menu editor.
i need only popup menu.
expecting a positve reply.
-------------------------------------------------
"HARD WORK NEVER END FAILS"
-------------------------------------------------

Zooming Various Size Image To Fixed PictureBox Without Changing The Image Ratio
Yup!I need to scale different size image into a fixed picturebox. Without changing the image height vs width ratio.any of you can help me? thanks.
1)scale the image as big as possible depending the fixed picture box height or width.


I use the loadpicture function in loading picture.
If I use the image control, I found the stretch function will cause the image height and width ratio change.

thanks

(Image Size, Image Adrress, And Creation Time) Of A Process ?
how can I get (Image size, Image Adrress, and Creation time) of a process if I knpw the ID or the handle ?!

thanx,

How Can I Figure Out The Size Of An Image File Without Loading The Image?
There might a control or two on the market that do that, but i think they require that the image be loaded as well, so i don't think you'll be able to do that.

How To Size The Image With Picture Box Size?
I use ADO and view the image on the picturebox ("Picture2").Why the image display on the picture box don't have same size with my picturebox?How to make the image display have same size with my picturebox.


Code:

Picture2.Picture = LoadPicture(Pesttable.Fields("PICTURE"))

Image Size To Picturebox Size
how can i make an image the same size as that of the picturebox displaying it.
i.e. stretching it accross the picturebox no matter how small or how big, just stretch it.

Size Window To Image Size
If I load a picture in to a picture box which is in turn on a form, how can I resize the form to the size of the picture once the picture has loaded?

Cheers

John

Conforming Image Size To Picturebox, Not Picturebox To Image Size.
Hello all, i am taking a VB course (Using VB 6) and have run into a little problem.

I need (or want) to have it so users are viewing like... a gallery of the images, on each command button in my frame i have the code
Code: picturebox.picture = loadimage ("imagepath")
(ive run into the issue of running it on another machine and the images not appearing but thats a seperate issue, a seperate topic if i need it eventually)

what ive been able to do is use
picturebox.autosize = true
to make the picture box the size of the image, but thats 4 times as big as the original box and twice as big as my program window (frame?)

ive also tried .scalehight/width but i couldnt get any change with that.

ive searched multiple forums and couldnt find an answer, any help?

thanks in advance

Inserting Image In Vb Project As Per Database(as Data Changes Image Should Also Change)
i am making front end in vb6 and backend in ms access
i want as my data changes on movenext
concerned photo should also change
i am using data environments

please help

Image Size From Image Control...
Hi,

Hi, I wrote a simple app that loads an jpg image in an image control, but I need to know what the width and height of the image are... the imagecontrol is set on strectch = true.

Any help would be appreciated.

Thanks

DB Size Does Not Change ??
hi all,

i was working on a code to upload my outlook mails to an access database. i managed that ... and i realised my access DB size swelled. So i went to the tables and deleted all the records manually. and now all my tables are empty. But my DB size does not change .... its still some 300MB.

can any one tell me whats happening here ??

to over come it i can just delete the DB and recreate a new one with the same structure, but i am curious to know.

thanks once again all you guys

-Vinod



Edited by - cjvinod on 1/24/2005 4:36:57 AM

How To Scroll Picture Box Image While Image Size Is Bigger Then Picture Box
Hi

I want to know how to add scroll facility in picture box while image size is bigger then picture box.

Regards
Varun Jain

How To Know Image Size
Hi im here with more questions ,
I have a CommonDialog1.ShowOpen for load a picture(bmp) but and i have a picture box for view this. the picture box have autosize,and have the format on PIXELS, the problem its that i dont want to permit that images more biggers than XLIMIT and YLIMIT have loaded here, and when detects that the image its bigger than the limits x,y sends me a message box saying why!!!
Can anybody help me?
Thanks
Regards

Image Fit Size
hi guys! can you please help in fitting an image into picure box, image should fit exactly to the size of picturebox so that you can see the whole image. here is how i upload my image into picturebox.

Code:
With CommonDialogBox
.Filter = "JPG Files|*.JPG|Bitmaps|*.BMP| GIF Files|*.GIF"
.ShowOpen
Text1.Text = .FileName
gsFileName = Text1.Text

End With

To Know Image Size
Hello,

(DirectX 8)

I need to know the PNG image size for strech and centered. My program load PNG images to show in screen. All images has diferent sizes. And when I draw the images in screen, the program draw to 1:1 scale and Top-Left alinged.


To read the image:

Set Imagen_rom = D3DX.CreateTextureFromFileEx(D3DDevice, ImageFile, D3DX_DEFAULT, D3DX_DEFAULT, 1, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_FILTER_NONE, &HFF000000, ByVal 0, ByVal 0)


In render module:

Sprite_Rom.Draw Imagen_rom, SourceRect, Scaling, Center, Rotation, Translation, &HFFFFFFFF


It's possible to know the image file resolution for configure "SourceRect", "Scaling" and "Translation" variables?

Thank you, and excuse me for my english.

Image Size
I need a code that when the user enters an image URL into a text box the image Width and Height is displayed in another 2 text boxes...

The code should find the size of the image...

Thanks!

Image Size
I am looking for a way to create a check script for images that i want to use for a powerpoint addin. I want to use the commondialog to select an image. and then place it in powerpoit (already working)

But now the size problem. I got 2 sizes for images (let's say size x and y).
If it has size x and it doesn't fit, a messagebox shout appear. But i can't seem to get it to work.

Anyone got an idea?

Image Size
The problem i have is i take a screen shot then place that image into an image control with the image controls property's set to stretch
so i have what looks like a thumbnail i then want to save that image to a file but at the dimensions of the image control
not the dimensions of the screen

any help would be apreciated

Image Size...
Why is it that a .bmp file can be like 500kb but if you turn around and save the same image as a .jpeg it will only be like 5kb? Is there a way to further compress images?

Image Re Size???
Hey there, I have just spend a few days doing a project which involves loads of pictures. I did it at home on my own computer, but i have to finnish it on a diff computer whitch is on a diff resolution....
When i loaded up my project today all the picture were huge and took up all of my form. Can anyone tell me how I might get the form to automaticly re size the images to fit inside their boxes?
All the best

How To Get The Image Size(kb)
Hello!

I have a project where i store pictures into the database!

I use the commondialog,adodc,datagrid and the stream so that i can store and the stored records. I have three columns the picfle the name and the size. How can i get the size of the image so that i can store it properly into the size column??? Here is a sample of my code (below). I see differences when i see the picture size in windows and then in the database. For example one image has 576 kb when i check it the folder (where the picture is stored) and then in the database in the size column i see this number 589878 or 589.87kb. Why???

Only a part of the code!


Code:
CommonDialog1.ShowOpen
sFile = CommonDialog1.FileName ->sFile is string

Adodc1.Recordset.Fields("Size").Value = FileLen(sFile) -> Is FileLen that i use wright??????
Adodc1.Recordset.Update

Image Size
I need a code that when the user enters an image URL into a text box the image Width and Height will be displayed in 2 other textboxes called

txtHeight
txtWidth

Any help?

Getting Image Size Using Api
I am trying to get this code to work

VB Code:
Private Type IMAGEPROPERTIES    pType As Long    pWidth As Long    pHeight As Long    pWidthBytes As Long    pPlanes As Integer    pBitsPixel As Integer    pBits As LongEnd Type Private Declare Function GetObject& Lib "gdi32" Alias "GetObjectA" (ByVal hObject&, ByVal nCount&, lpObject As Any) Private Function GetImageProp(Image_File_Path$) As IMAGEPROPERTIES     On Error Resume Next     Call GetObject(LoadPicture(Image_File_Path).Handle, Len(GetImageProp), GetImageProp)MsgBox GetImageProp.pWidth    If GetImageProp.pWidth > 200 Or GetImageProp.pHeight > 200 Then    Image1.Stretch = True    Else    Image1.Stretch = False    End If End Function Private Sub LstMovie_Click()     Image1.Picture = LoadPicture(App.Path & "" & Trim(rsSel.Fields("Picture")))            Call GetImageProp(Image1.Picture)end sub

the image loads, but it always fails the size check. the msgbox displays 0

if it matters I got this code from

http://www.vbforums.com/showpost.php...85&postcount=7

Image Size Too Big
i manage to save an image file to a local folder.
the problem is the size of the image file is 2MB.
anyone has the code to save and compress or reduce the image file size without lose the image color??

Getting Image Size, .NET
<<< delete post >>>

How To Know The Size On A Image ?
Hi, I have a lot a jpg picture and I want to only copy those where the Height is highter than weigh. So I only need to know how I can get the size on a picture to make my If condition ?

Thanks

Image Size
I have a picture thats bigger than the form can get, I.E. the size of the screen. How can I get the whole image to fit on the form?
Thanks

Chris

Image Size
I want a image in a imagebox and i want that the image size fit's in the imagebox his size

i need the visual basic command for it ...

How To Size Into Image
I am using the following code to put a *.bmp etc into a image component:

Private Sub File1_DblClick()

Set image1 = LoadPicture(Dir1 & "" & File1.FileName)

End Sub

My questions what code do I need to size it to the size of my image component. What is happening at the moment is that the photo is sometimes bigger or smaller than the image instelf.

Thanks in advance

Image Size
i want to display an 408*60*256 gif
how do i set the hight/width mesurements?

(in the position properties the size is'nt the same)

Get Image Size
hello!!

i´m doing a app that makes a webpage of all pictures in a folder and i need to know witch way the pic is tacken, if hight > width or hight < width

how do i get the image size ?

/ Rasu

Image Size
hi gurus,
i want to know the hight and width of image file(.gif,.jpg.bmp) by passing it's name and path as parameter.
thanx.

How To Change The Title Bar Size
I want to remove the default icon from the left corner of the title bar of the vb form. By modifying the BorderStyle property the icon is removed but the title bar height also reduces.

How to change the title bar size to normal size or to remove the icon without affecting the size.

USMAN

Change The Size Of Tabs
How do you change the tab sizes in a richtextbox??

Change Paper Size
what is the cording to change paper size and set as landscape .. what is the right cording i m trying like this

printer.papersize = 9
printer.oriantation = 2

its not working
y is that ??

what should i do

How To Change Pixel Size ?
Can we change the pixel size ? If yes how can we do it through VB ?

How To Change A Varchar Size ??
I need to change the size of two fields in my table. The existing sizes are not big enought. I tried using this code but it generates an error:

ALTER TABLE table1 {
ALTER COLUMN Field1 varchar(55),
ALTER COLUMN Field2 varchar(20);
}

And by increasing the size of the fields affect the existing data?

Change Field Size With DAO 3.5
Is it possible to change the size of a textfield, using DAO 3.5?

using the following alter table statement only seems to work with DAO 3.6.

Code:
ALTER TABLE Authors ALTER COLUMN Author varchar(57);
Malloc

Change Font Size In RTB, But Not All Of It!
I have the code below to change the size of the selected font in a RichTextBox.

If the user selects a different size font part way through using the RTB, how do I get the text from that point on to be the newly selected size?
I have a combobox with the sizes available for the font.


Code:
Private Sub cmbFontSize_Click()
On Error GoTo ErrTrap

If Len(rtbNotes.SelText) > 0 Then
rtbNotes.SelFontSize = cmbFontSize.List(cmbFontSize.ListIndex)
rtbNotes.SetFocus
Else
''rtbNotes.SelFontSize = cmbFontSize.List(cmbFontSize.ListIndex)
End If

Exit Sub

[VBA] Change Size Of Label
Hello,
I have an Access report. At the "onFormat" event I want to change the "height" of an element.
There is a line around this element (a box), so I check for the change of size.
So I tried:
Me.myElement.Height = 5
And this does work. I get a line (i don't even see the data).
But when I actually try to make the height very large for example 50, the maximum the box will grow on is whather space the text take.

How can I fix that ? Is there something I am doing wrong ?

The reason why I am trying to do this:
I have different info in my report
For example:
Info 1, Info 2, Info 3... and so on
When I generate my report each one of them is surrouned by a box (ie, border = solid).

Info 3 is a bit like a memo.
My problem right now is that the box around info 1 is not equal to the box around info 2 or info 3... I want to have all the boxes size to be equal to the largest.
So that's why I have to know how to set the height programatically so that when the report is generated it sets the heigh of the boxes to the height of the "tallest" box.
But if you have a way around let me know please !

thanks !


>>>>> UPDATE :
I fixed part of my problem.
I disabled the "Can grow" and "Can Shrink"
My issue now is for EACH detail i want to find the tallest size ( i know how to do that), but I don't know how in the "OnFormat" event do it for EACH detail in the report... right now it does it for everything... all the details box are the same....
please help,
thanks

>>>>> MORE UPDATE :

I did figure out to force the size of the fields. (the cangrow and canshrink have to be set to false)
My problem is that I want all the fiels to be the same size as the field with the tallest size.
The fields (Memo, and Description) are the tallest one no matter what.
So I want to do a check to see which one of the two is the tallest and then set the size of everything else equal to the tallest.

So right now I have in the OnFormat event:


If Me.Memo.Height > Me.Description.Height Then
Me.Field1.Height = Me.Memo.Height
Me.Field2.Height = Me.Memo.Height
Me.Field3.Height = Me.Memo.Height
Me.Field4.Height = Me.Memo.Height
Me.Field5.Height = Me.Memo.Height
Me.Field6.Height = Me.Memo.Height

Else
Me.Field1.Height = Me.Description.Height
Me.Field2.Height = Me.Description.Height
Me.Field3.Height = Me.Description.Height
Me.Field4.Height = Me.Description.Height
Me.Field5.Height = Me.Description.Height
Me.Field6.Height = Me.Description.Height

End If


PROBLEMS:
Right now this does not work.
BUT if I give a number instead of "Me.Descriptionm.Height" or Me.Memo.Height
Everything works properly.
I think it's because I have to write the code in a way so that it's applied to each "detail" iteration. I am not sure how.


The other problem is that the Memo and Description field are both set to "Cangrow" yes.
So that I know big they get.
Let's say Memo is bigger than description. I will want to set Description at the same size as Memo.
But I can't, because "Cangrow" is set as yes. And it does not look like I can change this setting from VBA...

Please help, it's a bit hard to understand, but I have been stuck for a long time on this one.

I am doing all of this to have all the solid lines around the fields sized the same. Because if I enable the cangrow option, i will a nice box around each field, but each one of them is different size... so it's looks a bit weird for a "table" type report.

Thanks for your help

Picture Change Able Size
i currently have a small doodle program but i want to be able to change the canvas size, like in MSpaint you can drag it to change size, how would i code this?

Change Another Window's Size
Can I change another window's width and height from my VB application If I know the caption on that window?
Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved