   [XNA] Scaling Texture makes it transparent
  Hello, my problem is like in the topic, my code:spriteBatch.Draw(buffer, new Vector2(x * iwidth, y * iheight), null, Color.White, 0, new Vector2(iwidth, iheight), 0.8f, SpriteEffects.None, 0);when scale factor is smaller then texture just disappears. I load 8bit Indexed PNG and then create a bitmap from it.here is my code:System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(System.Drawing.Image.FromFile(files));    Texture2D customTexture = new Texture2D(graphics.GraphicsDevice, bitmap.Width, bitmap.Height, 0, TextureUsage.None, SurfaceFormat.Color);System.Drawing.Imaging.BitmapData data =    bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, bitmap.PixelFormat);byte[] bytes = new byte[data.Height * data.Stride];Marshal.Copy(data.Scan0, bytes, 0, bytes.Length);customTexture.SetData(bytes);bitmap.UnlockBits(data);buffer.Add(customTexture);When i load them normally like this:buffer.Add(Texture2D.FromFile(graphics.GraphicsDevice,files));Textures scale normally but much slower, please help :) ?[Edited by - oracle1 on April 14, 2010 9:40:19 AM]
  The scale factor scales shape of sprite or scales texture?If it was scaling vector of pixel color it would scale 4th component, alfa vale.So alfavalues get close to 0 and you dont render them.....ouch. You render actualy those textures?System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(System.Drawing.Image.FromFile(files)); -you load a bitmap by passing to constructor new object of a Image that gets loaded from a file right on.Texture2D customTexture = new Texture2D(graphics.GraphicsDevice, bitmap.Width, bitmap.Height, 0, TextureUsage.None, SurfaceFormat.Color);-You allocate dx texture, okSystem.Drawing.Imaging.BitmapData data =    bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, bitmap.PixelFormat);byte[] bytes = new byte[data.Height * data.Stride];Marshal.Copy(data.Scan0, bytes, 0, bytes.Length);-Then you copy from this surface to byte[] array!customTexture.SetData(bytes);// trara, finaly we load the dx texture surfacet by this byte[] array.bitmap.UnlockBits(data);buffer.Add(customTexture);;  I am sure you can read map bytes from Image class right away as byte[] array.And load theese to dx surface right on without locking dynamic surfaces or so   ;  Also you have a DirectX utility function that loads from file of any format to dx texture object, and you use this dx texture object right on.I do not use utility functions, but I need them for this particular function:);  > I am sure you can read map bytes from Image class right away as byte[] array.Yes i can but setdata returns an error:The size of the data passed in is too large or too small for this resource.adn i cant convert textures because my app is image viewer   