473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Picture resizing

Hi all,
I have an application that requires me to load an image into
a picture or image or picclip control.Picture will be JPG format
and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
pixels. Question: Is it possible to save the image as a 200 X 100 image,
or can I only save it as 800 X 600?
I have tried, using a picture control, 'SavePicture Picture1.Picture,
"qaz.jpg"'
which does not save the resize the image.
Any pointers or help would be gratefull.

Cheers,
GST
Dec 12 '05 #1
2 14533
The image will be saved at its original size. The scale property of the
image control is visual only. You'll need to load the image at the original
size, then call the stretchblt API with the size of the new image. This will
reduce the physical size. The problem is that while VB will allow you to
save an image in its original format (eg bitmap, gif, jpg), I believe that
VB will only save the new image as a bitmap ... pretty sure you'll need some
other 3rd party library to save the resized image in a format other than
bitmap. You might want to post to msnews.microsoft.com
public.vb.winapi.graphics for detailed advice and tips. And check the past
posts there --- lots of GDI-related info of value.

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------

"Geoff Turner" <g.********@rl.ac.uk> wrote in message
news:dn**********@blackmamba.itd.rl.ac.uk...
: Hi all,
: I have an application that requires me to load an image into
: a picture or image or picclip control.Picture will be JPG format
: and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
: pixels. Question: Is it possible to save the image as a 200 X 100 image,
: or can I only save it as 800 X 600?
: I have tried, using a picture control, 'SavePicture Picture1.Picture,
: "qaz.jpg"'
: which does not save the resize the image.
: Any pointers or help would be gratefull.
:
: Cheers,
: GST
:
:

Dec 12 '05 #2
Geoff Turner wrote:
Hi all,
I have an application that requires me to load an image into
a picture or image or picclip control.Picture will be JPG format
and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
pixels. Question: Is it possible to save the image as a 200 X 100 image,
or can I only save it as 800 X 600?
I have tried, using a picture control, 'SavePicture Picture1.Picture,
"qaz.jpg"'
which does not save the resize the image.
Any pointers or help would be gratefull.


set picturebox.picture = picturebox.image
then try SavePicture again.
ps, VB can't natively save as JPG, you will need to use IJL or some
other 3rd party library.

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Dec 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel...
4
by: uuuuu | last post by:
I want my picture to fit into the page when viewed in IE. If I just view the picture on its own, I get the "Expand to normal size" button at the bottom right corner, but when its an html page I...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
2
by: Czort | last post by:
I'm looking for a good ActiveX component for picture resizing (gif, jpg, png) from asp script. It should be able to load an image from stream (f.e. from recordset, binary data source etc.). For...
14
by: hamil | last post by:
I am trying to display an image in a picture box. The image is a group 4 fax black and white image of a piece of sheet music. The original resolution is 300 X 300 dpi. I want to have the picture...
5
by: jason.tadeo | last post by:
I was wondering if anyone does any uploading picture scripts or how to do it where i could upload a picture and use php to change the picture size to what i want it to be. Anyone know where i could...
3
by: find clausen | last post by:
Is it possible to get the width of a picture: <img src="../graphics/press/bw21.jpg" width=400 height=555 alt="" border="0"> the make a box be exactly the width of the picture: ...
2
by: jodleren | last post by:
Hi! I am making an option, which opens a small window with a picture in it and data about it. I just want a JS script, which will get the picture size, and then set the window accordingly? ...
4
by: robertko2 | last post by:
Hello everyone, This is my first post here, and was hoping someone could lead me on the right track to quality resizing of drawing files like .bmp .jpg etc in VB6 Image or Picture boxes. I'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.