Discussion:
Sprite.Draw2d
(too old to reply)
Karsten Sosna
2007-07-14 06:25:37 UTC
Permalink
Hello NG,
first of all, i use DirectX9Managed. I have a bitmap(32 x 1504Pixel, 24Bit).
This bitmap includes 47 Images(32 x 32Pixel). Now i create a Texture and try
to draw a sprite via.
\\\
[Sprite].Draw2D(texture as Texture, srcRectangle As Rectangle,
destinationSize As SizeF, rotationPoint As PointF, rotationAngle As Single,
position As PointF, color As Color)
///
In first time the sourecerectangle is {0, 0, 32, 32} in next times are {0,
32, 32, 32}, {0, 64, 32, 32}, {0, 96, 32, 32} and so on. The destinationsize
is all times {32, 32}. Now if render the images, the sourceimagesizes are
not correct, it seems the sourceheight of the image are to small.
i have look in the documention of DirectX9m, but this overloads are not
documented.
Next i have a problem with transparent colors. The images have a transparent
color(Color.Black). How could i render the sprite with transparentcolor? In
DX7 i gives a ColorKey-Property, i miss that in DX9.

Sorry for my bad english.
Hopping for help.
--
With regards
Karsten
Karsten Sosna
2007-07-27 03:20:35 UTC
Permalink
Post by Karsten Sosna
In first time the sourecerectangle is {0, 0, 32, 32} in next times are {0,
32, 32, 32}, {0, 64, 32, 32}, {0, 96, 32, 32} and so on. The
destinationsize is all times {32, 32}. Now if render the images, the
sourceimagesizes are not correct, it seems the sourceheight of the image
are to small.
Hello NG,
This problem i have solved. I use 47 Ttextures.
Post by Karsten Sosna
i have look in the documention of DirectX9m, but this overloads are not
documented.
Hm, have anybody information, why this overload not documented?
Post by Karsten Sosna
Next i have a problem with transparent colors. The images have a
transparent color(Color.Black). How could i render the sprite with
transparentcolor? In DX7 i gives a ColorKey-Property, i miss that in DX9.
Here i still need help.
--
With regards
Karsten
ZMan
2007-07-27 04:53:02 UTC
Permalink
When you load the texture using the FromFile function there is an overload
that allows you to specify a colorkey
Post by Karsten Sosna
Post by Karsten Sosna
In first time the sourecerectangle is {0, 0, 32, 32} in next times are
{0, 32, 32, 32}, {0, 64, 32, 32}, {0, 96, 32, 32} and so on. The
destinationsize is all times {32, 32}. Now if render the images, the
sourceimagesizes are not correct, it seems the sourceheight of the image
are to small.
Hello NG,
This problem i have solved. I use 47 Ttextures.
Post by Karsten Sosna
i have look in the documention of DirectX9m, but this overloads are not
documented.
Hm, have anybody information, why this overload not documented?
Post by Karsten Sosna
Next i have a problem with transparent colors. The images have a
transparent color(Color.Black). How could i render the sprite with
transparentcolor? In DX7 i gives a ColorKey-Property, i miss that in DX9.
Here i still need help.
--
With regards
Karsten
Karsten Sosna
2007-07-28 08:12:44 UTC
Permalink
Post by ZMan
When you load the texture using the FromFile function there is an overload
that allows you to specify a colorkey
Thanks for the information, but i intialize the Textures with the overloads
using a bitmap. I have a function to change a color to transparent. It works
fine for me.
--
With regards
Karsten

Loading...