[Mono-list] Cannot find type? :-<
Maurizio Colucci
seguso.forever@tin.it
Wed, 30 Apr 2003 15:24:07 +0200
Hello,
I had almost finished porting my game, but the procedure to load a
texture-map won't compile!
texture-system.cs(65) error CS0246: Cannot find type=20
`System.Drawing.Imaging.BitmapData'
texture-system.cs(64) error CS0246: Cannot find type=20
`System.Drawing.Rectangle'
texture-system.cs(66) error CS0246: Cannot find type `System.Drawing.Color'
texture-system.cs(63) error CS0246: Cannot find type `System.Drawing.Bitmap'
What does it mean? I fear the worst...
Thank you!
Maurizio
=2D--
The code is (sorry for the italian language):
public void Carica_texture ( string a_Nomefile,=20
Color_key a_Color_key) {
// throw new Exception("not impl");
=20
if ( =C8_gia_presente(a_Nomefile))=20
throw new Exception("texture gi=E0 presente");
System.Drawing.Bitmap l_Bitmap;
System.Drawing.Rectangle l_Rect ;
System.Drawing.Imaging.BitmapData l_BitmapData ;
System.Drawing.Color l_Colore_pixel;
//ricordo l'handle
m_Handle_della_texture[a_Nomefile] =3D
m_Texture_handles[ m_Prossimo_indice_di_texture_libero];
//apro il bitmap
l_Bitmap=3D new Bitmap ( m_Path + a_Nomefile );
//copio uno nell'altro
l_Rect =3D new Rectangle(0, 0, l_Bitmap.Width, l_Bitmap.Height);
if(a_Color_key=3D=3DColor_key.LO_VOGLIO) {
l_Colore_pixel =3D l_Bitmap.GetPixel(1, 1);
l_Bitmap.MakeTransparent(l_Colore_pixel); =20
//in pratica la precedente istruzione setta il livello
//alpha=3D0 per ogni pixel che ha quel colore. se il bitmap ha
//un formato senza campo alfa, addirittura lo converte per
//avere alpha (credo).
}
l_BitmapData =3D l_Bitmap.LockBits(
l_Rect, =20
System.Drawing.Imaging.ImageLockMode.ReadOnly ,=09
System.Drawing.Imaging.PixelFormat.Format32bppArgb);
Gl.glBindTexture(Gl.GL_TEXTURE_2D,=20
m_Texture_handles[m_Prossimo_indice_di_texture_libero++]);
Gl.glTexParameteri(Gl.GL_TEXTURE_2D,
Gl.GL_TEXTURE_MAG_FILTER,Gl.GL_LINEAR);=20
Gl.glTexParameteri(Gl.GL_TEXTURE_2D,
Gl.GL_TEXTURE_MIN_FILTER,Gl.GL_LINEAR);
//genera la texture vera e propria
if(a_Color_key=3D=3DColor_key.LO_VOGLIO)
{
Gl.glTexImage2D(Gl.GL_TEXTURE_2D,=20
0,
(int)Gl.GL_RGBA,=20
l_Bitmap.Width,=20
l_Bitmap.Height,=20
0,
Gl.GL_BGRA_EXT,=20
Gl.GL_UNSIGNED_BYTE,=20
l_BitmapData.Scan0);
}
else
{
Gl.glTexImage2D(Gl.GL_TEXTURE_2D,=20
0,
(int)Gl.GL_RGB,=20
l_Bitmap.Width,=20
l_Bitmap.Height,=20
0,
Gl.GL_BGRA_EXT,=20
Gl.GL_UNSIGNED_BYTE,=20
l_BitmapData.Scan0);
}
}