[VB] Picturebox image scale problem

Questions about Wine on macOS.
Locked
dennykropka
Newbie
Newbie
Posts: 1
Joined: Sun Oct 27, 2013 5:04 am

[VB] Picturebox image scale problem

Post by dennykropka »

Hey.
I got problem with program in VB. It scale picture in picterebox. On windows work fine but on wine 1.6-rc5 it save bad image.
It show good image in picturebox but save bad.

Code: Select all

PictureBox1.Image = Image.FromFile(zrodlo) 
                Dim source As Bitmap = PictureBox1.Image 
                Dim dest_image As New Bitmap(80, 70) 
                Dim g As Graphics = Graphics.FromImage(dest_image) 

                Using objImage As System.Drawing.Image = System.Drawing.Image.FromFile(zrodlo) 
                    ' Display its Height and Width 
                    Dim scale As Double = objImage.Height / objImage.Width 
                    Dim width As Integer = Convert.ToInt32(dest_image.Height / scale) 
                    width = Int((width * 10 ^ 0) + 0.5) / 10 ^ 0 
                    Dim przesuniecie As Integer = Convert.ToInt32((dest_image.Width - width) / 2) 
                    g.DrawImage(source, przesuniecie, 0, width, dest_image.Height + 1) 
                    PictureBox1.Image = dest_image 
                End Using 

                Dim image2 As Image = dest_image 
                image2.Save(My.Settings.dir4 + nazwa_zdjecia.Text, System.Drawing.Imaging.ImageFormat.Jpeg) 

Windows/wine conv:
Image

Anyone got some idea how to fix this?
Locked