OpenNetCF Read Picture

Joined
Dec 1, 2006
Messages
3
Reaction score
0
Hi.

I wont to know where to get informations about: how to use OpenNetCF ?
Exactly, I want to know how to get my Bitmap in the IImage.

<...

Private Sub Alpha(byRef Bitmap1 as Bitmap, byval Bitmap2 as Bitmap)
...
Dim factory As ImagingFactory = New ImagingFactoryClass

factory.CreateImageFromStream(
new StreamOnFile(path + @"\Alpha.png"), image)



...
End Sub
...>

Here you see, that there is an "StreamOnFile" to get the Picture in the image (=IImage of OpenNetCF). But I have a Bitmap, not a file. The file is just from an code from the internet.

I use Vb.Net. But I think, if you have a C# example, its possible for me to translate them.

Thank you
 
This function gives me an error while creating the IImage.





Public Class clsAlphaBlend

Public Sub PaintAlpha(ByRef Bitmap1 As Bitmap, ByVal Bitmap2 As Bitmap, ByVal Value As Integer)

Dim hdcDst As IntPtr

Dim hdcSrc As IntPtr



Using gr1 As Graphics = Graphics.FromImage(Bitmap1)

hdcDst = gr1.GetHdc()

Dim image As IImage = Nothing

Dim factory As ImagingFactory = New ImagingFactoryClass

factory.CreateImageFromStream(ImageUtils.BitmapToIImageBitmap(Bitmap2), image)

Dim rcDst As RECT = New RECT(0, 0, Bitmap1.Width, Bitmap1.Height)

Dim rcSrc As RECT = New RECT(0, 0, Bitmap2.Width, Bitmap2.Height)

image.Draw(hdcSrc, rcDst, rcSrc)



gr1.ReleaseHdc(hdcSrc)

End Using

End Sub



 
Back
Top