From: Erich Foltyn on
all needs a lot of time to formulate the query, but I would like to show you
some code what I have got to run on:
http://www.erich-foltyn.at/ImageDownsize.htm
here is shown how I changed the content of an image
by use of:
image1.SetPixel(x, y, newColor),
but I could not change width and height of the image. The problem is also to
find the literature. Visual Basic Programming is hardly supported.
--
E.F.




From: Larry Linson on

"Erich Foltyn" <aon.912710183(a)aon.at> wrote in message
news:47963f21$0$2244$91cee783(a)newsreader01.highway.telekom.at...
> all needs a lot of time to formulate the query, but I would like to show
> you
> some code what I have got to run on:
> http://www.erich-foltyn.at/ImageDownsize.htm
> here is shown how I changed the content of an image
> by use of:
> image1.SetPixel(x, y, newColor),
> but I could not change width and height of the image. The problem is also
> to find the literature. Visual Basic Programming is hardly supported.

"Classic" Visual Basic, that is, VB 6.0 and earlier, was replaced in the
Microsoft Developer Tools pantheon years ago, by VB.NET. "Diehards," who
never made the transition, tend to frequent this newsgroup. So the personal
or business sites of people here are fertile ground, as are some of the VB
MVPs sites which you can find, or find links to, on http://www.mvps.org.
Other sites lost their incentive to be of help to Visual Basic and have
taken down material... that may be what you have encountered.

But, in general, VB was not a "programming language of choice" for very many
people for image and graphics processing; most image and graphics processing
programs were created using C, C++, or others. It is a superb language for
normal modest business programs, but this VB newsgroup may not be the best
place to get the answers you need.

Larry Linson
Microsoft Access MVP


From: Mike Williams on
On 22 Jan, 19:08, "Erich Foltyn" <aon.912710...(a)aon.at> wrote:

> here is shown how I changed the content of an
> image by use of: image1.SetPixel(x, y, newColor),
> but I could not change width and height of the
> image. The problem is also to Visual Basic
> Programming is hardly supported.

Manipulating images is very easy Visual Basic. The code can be
extremely simple or quite complex, depending on exactly what it is you
want to do and how quickly you want to do it. On the assumption that
you are using VB5 or VB6 here is some code to show you one very simple
method of loading a picture and reducing its size and saving it out
again as a standard 24 bit bmp file. If there is something different
you want to do then post again. Anyway, try the following example, and
a VB Form containing one Picture Box and one Command button. Change
the hard coded picture path to the name of a picture that exists on
your own system:

Private Sub Command1_Click()
Dim p1 As StdPicture, Wide As Long, High As Long
Dim newWide As Long, newHigh As Long
Set p1 = LoadPicture("c:\temp\tulips.jpg")
Wide = ScaleX(p1.Width, vbHimetric, vbPixels)
High = ScaleY(p1.Height, vbHimetric, vbPixels)
newWide = Wide / 4: newHigh = High / 4
Me.ScaleMode = vbPixels
Picture1.ScaleMode = vbPixels
Picture1.BorderStyle = vbBSNone
Picture1.AutoRedraw = True
Picture1.Cls
Picture1.Move 0, 0, newWide, newHigh
Picture1.PaintPicture p1, 0, 0, newWide, newHigh
SavePicture Picture1.Image, "c:\temp\smallpic.bmp"
' following line not really required but it is handy
' to show the original size of the picture
Set Me.Picture = p1
End Sub

Mike