Hi
Many thanks. Is the scaling proportional? If not, is there a way to maintain
image height and width ratio during scaling?
Thanks again.
Regards
Hi
How can I create a bitmap from a JPG file scaled to a certain height and
width? I have checked in help and found Bitmap.Bitmap(Image, Size)
constructor but can't seem to find an example on how to use it.
Thanks
Regards
Hi,
You can also use Bitmap(Image, width, height) constructor to specify
new size parameters seperately as follows:
Imports System.Drawing
' Use width=300, height=400 for example
Dim mybitmap As New Bitmap(Image.FromFile("c:\image.jpg"), 300, 400)
or...
Dim mysize As New Size(300, 400)
Dim mybitmap2 As New Bitmap((Image.FromFile("c:\image.jpg")), mysize)
Image class's FromFile method gathers file from specified file
location and used for passing the image as first parameter of Bitmap
class, the rest are size's parameters as seen above.
Note: Image class also provides getting image using FromHBitmap and
FromStream static (shared) methods as well as FromFile method.
HTH,
Onur Güzel