Ok so I'm reviving an old project that uses old school managed DirectX. I know its deprecated but I'm really hoping I can get a straight answer without everyone focusing on the wrong thing
I want to draw some stuff (images/textures) onto a larger texture, and then show that larger texture on the screen. Then I want to shrink the larger texture (scale it down) slowly over time. So far everything seems to work fine until I start shrinking the texture. The transparency seems to shrink along with the scale, and the whole thing slowly fades away as it gets smaller! I've been scratching my head for hours and I'm sure its one of those easy answers to the right person. Please let me know what could be happening!
Ive stripped my code down to a pretty simple example below. I even was able to remove all the drawing-to-texture code. It currently just draws a 524x524 square of Orange. When it scales down, it dissapears !
Not shown in the code below, but I have the scaleFactor variable slowly transition from 1.0f to 0.0f. The orange square slowly fades to black (the background is black so I believe the opacity of the orange square is also going from 1 to 0). The square actually fades away to nothing long before its size is reduced to zero. I'd guess that its completely faded away by the time its scaled to about 50% size.
mapSprite = new Sprite(GraphicsMain.m_device);
mapTexture = new Texture(GraphicsMain.m_device, 524, 524, 0, Usage.RenderTarget, Format.A8R8G8B8, Pool.Default); //Format.A8R8G8B8
Surface surface = mapTexture.GetSurfaceLevel(0);
Surface buffer = GraphicsMain.m_device.GetRenderTarget(0);
GraphicsMain.m_device.SetRenderTarget(0, surface);
GraphicsMain.m_device.Clear(ClearFlags.Target, System.Drawing.Color.Orange, 1.0f, 0);
// draw some stuff here..
// Done rendering to texture
GraphicsMain.m_device.SetRenderTarget(0, buffer);
// now draw it to screen
mapSprite.Begin(Microsoft.DirectX.Direct3D.SpriteFlags.AlphaBlend);
mapSprite.Transform = Matrix.AffineTransformation2D(scaleFactor, Vector2.Empty, 0, new Vector2((float)50, (float)50));
mapSprite.Draw(mapTexture, Vector3.Empty, Vector3.Empty, Color.White.ToArgb());
mapSprite.End();