Jump to content
  • Advertisement
Sign in to follow this  
mobii

Manage C# Many Textures from one Picture

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Manage C# DirectX9 Question: if someone have a example that load one Texture spriteTexture and have a function that can draw one small texture from spriteTexture Example I get from Managed DirectX 9 ISBN: 0672325969 and Example work fine in book but not when me use an other .tga picture this is how me try do: // ------------------------------------------------------------------------ I try take out pictures from t Example try take out picture 6 from row 0: ar.Add(new Art(1000, 1000, 1, 11)); // Add new Sprite ((Art)ar[0]).Draw(sprite, spriteTexture, X, Y, 0, 6, Color.White); // Draw Sprite 6
public void Draw(Sprite sprite, Texture t, int X, int Y, int r, int c, Color Col)
{
	sprite.Draw2D
	(
		t,
		new Rectangle(X * 50 ,Y * 0, 50, 50),
		System.Drawing.Rectangle.Empty,			// this Rectangle I no know what does
		new System.Drawing.Point(X, Y),
		Col
	);
}



I get this Graphical error: http://62.101.51.60/BLH/images/user/8_0327195902.jpg the Blue is what me get on screen and White is Texture spriteTexture small Texturepicture is (0-49 * 0-49) // ------------------------------------------------------------------------ PS: How u spinn (change angle) of sprite? [Edited by - mobii on March 29, 2005 4:59:29 AM]

Share this post


Link to post
Share on other sites
Advertisement
I just write say me get help from Post:
http://www.gamedev.net/community/forums/topic.asp?topic_id=306845&whichpage=1?

to get Picture in right size I use:

spriteTexture = Direct3D.TextureLoader.FromFile
(
device,
@"..\..\t.tga",
1000, // Picture Width
1000, // Picture Height
0,
Direct3D.Usage.None,
Direct3D.Format.A8R8G8B8,
Direct3D.Pool.Default,
Direct3D.Filter.None,
Direct3D.Filter.None,
0xFFFFFF
);
// if u do like this u get Error if u going take out textures from Pic
spriteTexture = TextureLoader.FromFile(device, @"..\..\t.tga"); // OK to whole pic but no to many textures


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!