I have a silverlight application in which I have a map control. I want to save the map into a jpg/png file format to the disk.
I got this link http://www.silverlightshow.net/items/Capturing-a-Silverlight-Screen.aspx but it uses some third party library to save the WriteableBitmap into the file/disk. I do not want to use any third party control. Is there any standard .Net API/way to save the image capture to the disk?
Atul Sureka
Related
I need to import a pdf file as background that I can draw on it. I want to some new figures and I want to highlighten some areas.
I was searching the Internet for the last three days. The only thing I found ist the opposite, writing to pdf files.
/* does the other way */
cairo_pdf_surface_create();
First I tried this command but when I realized that it's overwriting my source file instead of importing it.
I am using GTK3 and C for writing my program.
As you've already figured out, it's not a straightforward task: GTK doesn't have PDF rendering features, so you have to use some external library.
I recommend taking a look at Evince, GTK document viewer. It has different backends for different document types. For PDF it's ev-poppler.cc and it uses poppler library.
Inside that ev-poppler.cc there is pdf_page_render which renders a single page and pdf_document_get_page which gets a single page from backend.
Now, I have my simple project on changing the color image into white&black image using CUDA-C.
But I got a problem with importing/loading a bitmap image into program. I don't know how to import it.
So...
CUDA-C have a specific function about importing/loading bitmap image?
If yes, what is it and how to use it?
If no, how do you do with importing/loading bitmap image?
Thank you.
There's really nothing that is CUDA-specific about loading a bitmap image into an application.
If you have a preferred method for loading a bitmap image into an application, you should be able to use it with a CUDA app. You will obviously be loading the image into the host application space first. After that, if you want to transfer it to the device, you can use any of the standard methods for transferring data to the device to accomplish this.
CUDA (i.e. the runtime API) doesn't have any specific functions for importing/loading a bitmap image
-
There are many ways to load an image. If you are already using OpenGL or DirectX, then you will want to use a method associated with one of those APIs, and then use the appropriate interop API within CUDA to manipulate the object.
If you want to import a bitmap image directly into a CUDA program without using a graphics API, take a look at the CUDA samples, as a number of them do this and provide helper functions that you may want to re-use.
For example, the dct8x8 sample provides a file called BmpUtil.cpp which contains a number of useful bitmap import/handling routines, and the dct8x8 app (dct8x8.cu) shows how these may be used directly in a CUDA app.
I'm developing a WPF based app in C# and I want to play an h.264/aac encoded mp4 file from a stream source that derives from System.IO.Stream.
I can play videos directly from local files, and from a URL source, but I also need to playback video from a data source that derives from System.IO.Stream. Specifically, I'm using a product from Eldos called Solid File System (http://eldos.com/solfs/) which allows you to create virtual file systems inside a single file. To access data stored inside a SolidFS file they offer SolFSStream which derives from System.IO.Stream.
Does anyone know of a .Net Framework API, or third party API that will allow me to play the video by passing in the stream reference?
My preference would be to copy the files to a temp directory that the application can access, then use a simple to use and robust library to play the file e.g http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx
My reasoning would be that supporting stream may not be the best criterea to choose a third party library to play mp4 files. You need to ensure that the library is robust and easy to integrate with your existing application.
Please note, by referring to the MediaPlayer class I am not saying that this is the most robust library, but it has met my use cases in the past and was easy to integrate with the application.
DirectX had some methods to play custom streams, but I don't know details. Also, we offer OS edition of SolFS for usage scenarios like yours - you can have a virtual disk with OS edition and play from there (and disk access can be restricted to only your application and the player for security).
this is my 1st question in the site.
I need a 3DS model loader for opengl applications. Loader should also be able to load .jpg textures. I tried to use OpenSceneGraph for this purpose but this time I have to also use the whole OpenSceneGraph data structure to render the scene. Is it possible to use OpenSceneGraph only for model loading and do the rest with standart opengl code, especially glTranslate, glRotate, etc.
Googling turned up this: lib3ds
Not sure if it can read JPEGs but that should be easy enough with libjpeg or equivalent.
OpenSceneGraph uses "plugins" to load file formats - both models and textures. There are working plugins for 3ds and for jpeg, though at least the jpeg one (I believe) isn't built in the default configuration - when creating the OpenSceneGraph makefiles (or projects on Windows), you need to specify the location of the libjpeg files in order for it to be built (as the plugin is based on that library). Once you have these two plugins, you'll have no problem reading 3ds files and jpeg textures. Another option is to use some other convertor which supports both osg (or ive) - OpenSceneGraph's native format- and 3ds. Blender comes to mind, and it's free...
As for mixing openGL calls with OpenSceneGraph - that can be tricky, but possible. One option is to derive your own class from Drawable, then override its draw implementation method, and place it anywhere you want in the graph, though manually drawing the 3ds files defeats the whole purpose of using a scene-graph...
I understand that the SpeechSynthesizer (System.Speech.dll) can be used to convert text to speech. I am working on an application that requires the ability of saving the text as mp3 and wav file.
Is this possible using WPF?
I believe that you should be easily able to save to a WAV file via SpeechSynthesizer::SetOutputToWaveFile. I don't think there is built-in support in .NET for converting to MP3, but this should be straightforward with the help of a 3rd party library/utility (like LAME) once you have the audio data as WAV.