M
Martin Wolff
Hi !!
To draw multiple graphics objects which have different shapes, I’m using
the region class to exclude/union the drawing area of these Objects.
The rectangle around a single object is of the size of 80x80 pixels. So
looping through these pixels and excluding the area of every transparent
pixel, the region will be built.
Afterwards, such an object has a memory usage of approx. 700Kb (before
modifying the region it was nearly 300kb).
So can anybody tell me, how to provide Objects with transparent
background and also keeping the memory usage low.
A weblink to more information about this region class would also be
helpful.
Thanks in advance,
Martin.
PS: Special thanks to Tom Overbay who provided me with the first code to
create user icons.
Here is a code snippet to show, what the program does:
For y = 0 To MyBitmap.Height - 1
For x = 0 To MyBitmap.Width - 1
' Exclude alpha pixels
If MyBitmap.GetPixel(x, y).A = 0 Then
MyRegion.Exclude(New Rectangle(x, y, 1, 1))
End If
Next
Next
..
..
To draw multiple graphics objects which have different shapes, I’m using
the region class to exclude/union the drawing area of these Objects.
The rectangle around a single object is of the size of 80x80 pixels. So
looping through these pixels and excluding the area of every transparent
pixel, the region will be built.
Afterwards, such an object has a memory usage of approx. 700Kb (before
modifying the region it was nearly 300kb).
So can anybody tell me, how to provide Objects with transparent
background and also keeping the memory usage low.
A weblink to more information about this region class would also be
helpful.
Thanks in advance,
Martin.
PS: Special thanks to Tom Overbay who provided me with the first code to
create user icons.
Here is a code snippet to show, what the program does:
For y = 0 To MyBitmap.Height - 1
For x = 0 To MyBitmap.Width - 1
' Exclude alpha pixels
If MyBitmap.GetPixel(x, y).A = 0 Then
MyRegion.Exclude(New Rectangle(x, y, 1, 1))
End If
Next
Next
..
..