From: ..:: Kevin ::.. on
If I load a PictureBox image from an embedded resource within my application
it works fine but if I load the same image from a file using OpenFileDialog
(as an ImageStream or using the file name) the background color is not masked
out.

Any ideas?
From: Herfried K. Wagner [MVP] on
"..:: Kevin ::.." <Kevin(a)discussions.microsoft.com> schrieb:
> If I load a PictureBox image from an embedded resource within my
> application
> it works fine but if I load the same image from a file using
> OpenFileDialog
> (as an ImageStream or using the file name) the background color is not
> masked
> out.

Which image format does the image have?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

From: ..:: Kevin ::.. on
I have tried with a bmp image and a gif image and the problem is the same for
both formats

"Herfried K. Wagner [MVP]" wrote:

> "..:: Kevin ::.." <Kevin(a)discussions.microsoft.com> schrieb:
> > If I load a PictureBox image from an embedded resource within my
> > application
> > it works fine but if I load the same image from a file using
> > OpenFileDialog
> > (as an ImageStream or using the file name) the background color is not
> > masked
> > out.
>
> Which image format does the image have?
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>
>
>
From: Cor Ligthert [MVP] on
Kevin,

There seems something very special in you code. The OpenFileDialog is only
giving a string to use in the by instance image.fromstream command.

I hope this helps,

Cor


"..:: Kevin ::.." <Kevin(a)discussions.microsoft.com> schreef in bericht
news:2DD847E9-36C0-4F81-BCE4-9A54A3803A85(a)microsoft.com...
> If I load a PictureBox image from an embedded resource within my
> application
> it works fine but if I load the same image from a file using
> OpenFileDialog
> (as an ImageStream or using the file name) the background color is not
> masked
> out.
>
> Any ideas?


From: ..:: Kevin ::.. on
Cor,

The code I am using is as follows:

Dim ImageStream As System.IO.Stream

If openFileDialog1.ShowDialog() = DialogResult.OK Then

ImageStream = openFileDialog1.OpenFile()

If Not (ImageStream Is Nothing) Then

picImage.Image = Image.FromStream(ImageStream)

End If

End If


"Cor Ligthert [MVP]" wrote:

> Kevin,
>
> There seems something very special in you code. The OpenFileDialog is only
> giving a string to use in the by instance image.fromstream command.
>
> I hope this helps,
>
> Cor
>
>
> "..:: Kevin ::.." <Kevin(a)discussions.microsoft.com> schreef in bericht
> news:2DD847E9-36C0-4F81-BCE4-9A54A3803A85(a)microsoft.com...
> > If I load a PictureBox image from an embedded resource within my
> > application
> > it works fine but if I load the same image from a file using
> > OpenFileDialog
> > (as an ImageStream or using the file name) the background color is not
> > masked
> > out.
> >
> > Any ideas?
>
>
>