|
|
Up |
|
|
  |
Author: Mr. PoliticsMr. Politics Date: Jun 10, 2008 23:53
ok...
This isn't working, and I dont know why, when I pass the resulting
surface to StretchRectangle I get the awsome "error in application"
haha... anyway. Is this not the right way (using .Net 3.5 runtime and
the latest DirectX Dev Kit form March) to turn a bitmap into a
surface?
Public Function img2surface(ByVal img As Bitmap) As Direct3D.Surface
Dim image As Direct3D.Surface
image = New Direct3D.Surface(device, img,
Direct3D.Pool.Default)
Return image
End Function
|
| |
|
| | 7 Comments |
|
  |
Author: Mr. PoliticsMr. Politics Date: Jun 11, 2008 13:58
On Jun 11, 2:53 am, "Mr. Politics" gmail.com> wrote:
> ok...
>
> This isn't working, and I dont know why, when I pass the resulting
> surface to StretchRectangle I get the awsome "error in application"
> haha... anyway. Is this not the right way (using .Net 3.5 runtime and
> the latest DirectX Dev Kit form March) to turn a bitmap into a
> surface?
>
> Public Function img2surface(ByVal img As Bitmap) As Direct3D.Surface
> Dim image As Direct3D.Surface
> image = New Direct3D.Surface(device, img,
> Direct3D.Pool.Default)
> Return image
> End Function
any ideas?
|
| |
|
| | no comments |
|
  |
Author: Chuck Walbourn [MSFT]Chuck Walbourn [MSFT] Date: Jun 11, 2008 14:36
There are any number of potential problems here. You have no testing for
supported formats and required conversions, no testing for sufficient
continous texture memory for the size of the image, no testing for
non-square texture support, etc.
If you are completely new to Direct3D, I highly recommend you check out one
of the books on managed DirectX or better yet check out the XNA Game Studio
product.
--
Chuck Walbourn
SDE, XNA Developer Connection
This posting is provided "AS IS" with no warranties, and confers no rights.
|
| |
| no comments |
|
  |
Author: Mr. PoliticsMr. Politics Date: Jun 11, 2008 15:23
On Jun 11, 5:36 pm, "Chuck Walbourn [MSFT]"
online.microsoft.com> wrote:
> There are any number of potential problems here. You have no testing for
> supported formats and required conversions, no testing for sufficient
> continous texture memory for the size of the image, no testing for
> non-square texture support, etc.
>
> If you are completely new to Direct3D, I highly recommend you check out one
> of the books on managed DirectX or better yet check out the XNA Game Studio
> product.
>
> --
> Chuck Walbourn
> SDE, XNA Developer Connection
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
|
| Show full article (1.06Kb) |
| no comments |
|
  |
Author: Chuck Walbourn [MSFT]Chuck Walbourn [MSFT] Date: Jun 11, 2008 16:50
XNA Game Studio is focused on C# managed develompent for Xbox 360, Windows,
and Zune. While it is intended primarily for game developers, there's
nothing stopping anyone from using it for other purposes. In fact, you can
use other managed languages than C# with the XNA Framework assemblies with
some effort.
If you are just trying to display a bitmap, that's probably easier done with
traditional GDI operations unless performance is a big issue for you because
of animations or otherwise moving large images around on the screen.
DirectDraw is indeed out-moded. On Windows Vista, it just turns around and
calls Direct3D 9 primitives.
There are any number of books on Managed DX. A search an online bookstore
will probably show dozens.
--
Chuck Walbourn
SDE, XNA Developer Connection
This posting is provided "AS IS" with no warranties, and confers no rights.
|
| |
| no comments |
|
  |
Author: Mr. PoliticsMr. Politics Date: Jun 11, 2008 17:30
On Jun 11, 7:50 pm, "Chuck Walbourn [MSFT]"
online.microsoft.com> wrote:
> XNA Game Studio is focused on C# managed develompent for Xbox 360, Windows,
> and Zune. While it is intended primarily for game developers, there's
> nothing stopping anyone from using it for other purposes. In fact, you can
> use other managed languages than C# with the XNA Framework assemblies with
> some effort.
>
> If you are just trying to display a bitmap, that's probably easier done with
> traditional GDI operations unless performance is a big issue for you because
> of animations or otherwise moving large images around on the screen.
>
> DirectDraw is indeed out-moded. On Windows Vista, it just turns around and
> calls Direct3D 9 primitives.
>
> There are any number of books on Managed DX. A search an online bookstore
> will probably show dozens.
>
> --
> Chuck Walbourn ...
|
| Show full article (1.51Kb) |
| no comments |
|
  |
Date: Jun 14, 2008 10:39
[Please do not mail me a copy of your followup]
"Mr. Politics" gmail.com> spake the secret code
p25g2000hsf.googlegroups.com> thusly:
>Performance is a huge issue, what I'm constructing is a ticker tape
>program that runs along the bottom of the screen.
This sort of thing has been done in GDI for years at acceptable
performance, though. We're not talking millions of polygons in order
to render a ticker tape.
|
| |
| no comments |
|
  |
|
|
  |
Author: kodecharliekodecharlie Date: Jul 7, 2008 13:37
Try this:
0. Create a vertex buffer with the four corners of the bitmap.
1. Create an index buffer delineating 2 triangles that overlay the
rectangular boundaries of the bitmap.
2. Create a texture (ie, memory from VRAM).
3. For each new bitmap image:
i. Create a surface in system RAM that holds the bitmap image.
ii. Upload the surface to the texture.
iii. Call Present().
You'll need to set up Present_Parameters with a single back buffer,
as well as suitable vertices for your texture.
Good luck,
kodecharlie
On Jun 14, 10:39 am, legalize+jee...@ mail.xmission.com (Richard
[Microsoft Direct3D MVP]) wrote:
> [Please do not mail me a copy of your followup]
>
> "Mr. Politics" gmail.com> spake the secret...
|
| Show full article (1.35Kb) |
| no comments |
|
|