E
EricJ
back at the saturday job
all help is welcome ( if there is an other way of doing this i don't mind as
long as it works)
i have to compose an image in code.
I have a background image (a bitmap but i can convert it if needed) and an
image of a cross (bit like the close button on an xp form)
i have to place the cross a limited nr of times on the background image at
specific coordinates
when this is done i have to save the new image w crosses in an sql db (this
should not be a prob)
code below
when i try to get the graphicsfrom the bitmap i get an error :
Graphics object cannot be created from an image that has an indexed pixel
format.
tnx in advance
eric
Private schGra As Graphics
Try
Dim s As System.Drawing.Image
s = System.Drawing.Image.FromFile("F:\OvrAlles4.bmp")
schGra = Graphics.FromImage(s) ' this gives the error
Dim kr As New Bitmap(imgLijst.Images(0))
Dim t As Image
t = imgLijst.Images(0)
For i As Integer = 0 To 100
If kruisjes(i).Visible Then
schGra.DrawImage(t, (kruisjes(i).Left),
(kruisjes(i).Top))
'schGra.DrawImage()
End If
Next
PictureBox1.Image = s
Catch ex As Exception
MessageBox.Show(ex.HelpLink & " " & ex.Message & " button2 klik
", "fout", MessageBoxButtons.OK)
End Try
all help is welcome ( if there is an other way of doing this i don't mind as
long as it works)
i have to compose an image in code.
I have a background image (a bitmap but i can convert it if needed) and an
image of a cross (bit like the close button on an xp form)
i have to place the cross a limited nr of times on the background image at
specific coordinates
when this is done i have to save the new image w crosses in an sql db (this
should not be a prob)
code below
when i try to get the graphicsfrom the bitmap i get an error :
Graphics object cannot be created from an image that has an indexed pixel
format.
tnx in advance
eric
Private schGra As Graphics
Try
Dim s As System.Drawing.Image
s = System.Drawing.Image.FromFile("F:\OvrAlles4.bmp")
schGra = Graphics.FromImage(s) ' this gives the error
Dim kr As New Bitmap(imgLijst.Images(0))
Dim t As Image
t = imgLijst.Images(0)
For i As Integer = 0 To 100
If kruisjes(i).Visible Then
schGra.DrawImage(t, (kruisjes(i).Left),
(kruisjes(i).Top))
'schGra.DrawImage()
End If
Next
PictureBox1.Image = s
Catch ex As Exception
MessageBox.Show(ex.HelpLink & " " & ex.Message & " button2 klik
", "fout", MessageBoxButtons.OK)
End Try