C
Crirus
Strange behaviour: I havea bitmap that I draw and add to an array of
bitmaps...
Do I have to create a bitmap using New every time?
I tried to draw the bitmap in a for loop alike this:
Dim mask As Image = getPicture("mask")
Dim tempMask As Bitmap=New Bitmap(tile.Width, tile.Height)
Dim grMask As Graphics= Graphics.FromImage(tempMask)
Dim x As Integer
For i As Integer = 0 To tile.Width * 14 Step tile.Width
grMask.DrawImage(mask, New Rectangle(0, 0, tile.Width,
tile.Height), New Rectangle(i, 0, tile.Width, tile.Height),
GraphicsUnit.Pixel)
imgTranzMask(x) = tempMask
x += 1
Next
When I try to draw each bitmap from array seems that I have the same image
in all elements... array elements is a reference to the same bitmap?
bitmaps...
Do I have to create a bitmap using New every time?
I tried to draw the bitmap in a for loop alike this:
Dim mask As Image = getPicture("mask")
Dim tempMask As Bitmap=New Bitmap(tile.Width, tile.Height)
Dim grMask As Graphics= Graphics.FromImage(tempMask)
Dim x As Integer
For i As Integer = 0 To tile.Width * 14 Step tile.Width
grMask.DrawImage(mask, New Rectangle(0, 0, tile.Width,
tile.Height), New Rectangle(i, 0, tile.Width, tile.Height),
GraphicsUnit.Pixel)
imgTranzMask(x) = tempMask
x += 1
Next
When I try to draw each bitmap from array seems that I have the same image
in all elements... array elements is a reference to the same bitmap?