Jump to content
  • Advertisement
Sign in to follow this  
David Lake

Display jpeg on a form with SharpDX

This topic is 881 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

Hi all, would anybody kindly show me how to use SharpDX to display a jpeg on a form with the least amount of code please?

Its for my time lapse player program and I'm trying to improve performance over GDI+, I'm very good with C# and less so with C++ but DX is so confuzling.

Share this post


Link to post
Share on other sites
Advertisement

It could be because it sounds like you're just asking people to write code for you. What have you tried already? Can you draw a blank quad already? Can you draw a blank triangle? Anything? There are plenty of tutorials and indeed probably even some samples that come with SharpDX on setting up basic rendering and trying a colored triangle, which you can adapt to drawing a texture triangle and thus a quad eventually.

Edited by Josh Petrie

Share this post


Link to post
Share on other sites

I googled the hell out of this one but all I can find is incomplete and irrelevant bits and bobs that confuse the hell out of me.

Share this post


Link to post
Share on other sites

...such as?

 

The (potential) reason you're getting no responses is because you're basically saying "Hey, help me do something." The barrier to entry into your actual problem context is thus, quite high. If you lower the barrier to entry, by providing more information, more specifics about what you've tried, what you've got working, anything like that, you increase the chance that you'll get useful replies. It shows that you are respecting the time of (potential) respondents and in turn they'll be more likely to respect you and provide some assistance. 

 

This sample should display a simple, colored triangle. Can you get this to work? Can you replicate this in your own code? Can you then take that triangle and add a second triangle elsewhere? And then can you arrange them to form a square?

Share this post


Link to post
Share on other sites

Since nobody wants to offer some free help I will offer a £10 reward to whoever can help because I'm really stuck on this 1.

Share this post


Link to post
Share on other sites
But how do I use it, what else is needed like device context etc

 

 

That example appears to be using the SharpDX "Toolkit" library, which provides some high level, XNA-inspired functionality. You should just need to create a subclass of the Game class to get basic functionality up and running, although this does not look promising (specifically the warning about it being non-functional). 

 

 

why is the method an override

 

 

Because it's a virtual method from the base game class. Marking the method "override" is required in C# to override that virtual method; this ensures your version of the method is run when needed.

 

how do I load an image on every frame and dispose it on the next?

 

 

 

 

You probably don't want to do this as it will be slow. Load as many frames as you can up front, once, and simply switch the displayed image every frame. Unless those frames are dynamically generated and always unique, you don't want to throw them away until you'll never use them again (probably).

Share this post


Link to post
Share on other sites

Preloading the images and storing them in memory as bitmaps wont be practical not only because there will be too many but also due to the way I want to be able to play back the time lapse.

 

What do I need to start drawing with D2D to a RenderControl, what do I need to instance?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!