How to put DDS Textures on the OBJ in WPF (C#) - c#

All that I'm trying to do is to put the DDS on the OBJ captured by the Kinect v2.
I've retrieved the OBJ from Kinect as well as created the DDS texture but unable to put it on the OBJ.
Since I'm new to this ecosystem of Windows and 3D modelling. I'm unable to find any way to get this thing done. Any help would be very much appreciated.
The application is a Windows App using Windows 8.1 SDK and I'm using Helix-Toolkit to load OBJ.

hy,
its little bit late, but may be it will help,
with the .obj file there is a file with .mtl extension in this file you fill find the reference to materials used in .obj file and eventually the reference to textures files .

You will also need a handler for dds files. System.Drawing.Design, can take of this for you.

Related

How to create an Image Thumbnail in Unity3D on Android through C# code?

I've got some C# code in Unity that grabs a large image from my Android Device's filesystem, and now with it I want to use it to create a small thumbnail image.
I've found lots of different suggestions for how to do this such as the following:
MemoryStream outputStream = new MemoryStream();
System.Drawing.Image image = System.Drawing.Image.FromFile(originalImagePath);
System.Drawing.Image thumbnail = image.GetThumbnailImage(thumbnailWidth, thumbnailHeight,()=>false, IntPtr.Zero);
thumbnail.Save(outputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
return outputStream;
However, as with the above method, all of the methods I've found require you to use the System.Drawing namespace. And I can't for the life of me get the functions in this namespace to work on Android, because even after adding "System.Drawing.dll" into the Assets folder, I get an error saying that it can't locate "gdiplus.dll" on construction of "System.Drawing.Image". I tried downloading and adding said "gdiplus.dll" to Assets, but I just get the same error as if it can't find it!
I don't understand why its so hard to get the System.Drawing functions working in Unity, but that's somewhat besides the point, as all I really want to do is create a thumbnail of an image that lives on the user's Android Device. Any suggestions would be welcome!
EDIT: I forgot to mention that I'd like to avoid solutions that use Texture2D's because they can't be run off the main thread, and hence come with performance consequences =(
Thanks in advance! =)
Don't use Texture2D.Resize, because the resulting texture will become grey:
After resizing, texture pixels will be undefined.
See this post for other solutions.
Old answer
I recommend use an opensource C# image processing library, such as ImageSharp or search it on GitHub.
The last solution is to write one yourself, if the performance or size of a 3rd-party library is still not good enough.
Here are two ideas I can come up with:
split the possibly lengthy reading and resizing procedure into several Coroutines.
use multi-thread
You may also try calling java functions from Unity3D. But I'm not familiar with that.

Capture a single image and save it Kinect v2

I have a small problem that I am sure has an easy fix but I am having difficulty finding an example or working code. I am programming in Visual Studio using C#.
I am trying to capture an image from the Kinect (v2) device. The device is already working as its intended in my programme and is displaying the colour feed and skeletal data on screen. When the user meets certain conditions, I want to write a method to capture 5 or so consecutive frames from the camera and save those image files somewhere on my computer.
I have been looking at examples such as Capture Image from Kinect v2 Sensor but these aren't really leading anywhere! I have read that I should be using CanvasBitmap method but not really sure where to take it from there?
Any help would be appreciated
The ColorBasics Sample, (stored in C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Samples\Managed\ColorBasics-WPF after you have installed the Kinect v2 SDK) shows you how to store the color stream into a WriteableBitmap.
You can then use the information from this answer to store the image.

Working with BitMaps (PNG files) in XNA, System.drawing not available

I am sorry that this is a little bit ambiguous. I am having an issue using System.Drawing in XNA; from my research it is not available to XNA (since its part of the windows.dll?)
I want to create a sprite sheet analyzer which automatically dissembles a sprite sheet into its proper segmentation, number of frames, etc. for later playback. For this I need to grab the actual PNG file and it would be nice to have something that already has the functionality for working with images. Is there a class in XNA which provides similar functionality as System.drawing?
You can use System.Drawing in conjuction with XNA with no problem -- you just have to add a reference to it in your XNA project. However, System.Drawing does not support loading of .pngs, while XNA does.
The usual way to load images in XNA is to first add them to your content project (usually when you create an XNA project there is always a corresponding content project created). Add the saved .png to your content project and give it a unique name. Then in your code, load the image as a Texture2D:
Texture2D myTexture = Content.Load<Texture2D>("my image name");
Note the use of Content which is a ContentManager object that can be referenced from the Game object you are currently using for your XNA game.
Check this out for more information.
I found the answer. I can actually obtain the color data from the texture2D, allowing me to disassemble an image for analysis without using any extra libraries outside of XNA
http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Texture_to_Colors.php

C# Move video files into folders based on their video frame size.

I have a hard drives dedicated to videos, and I wanted to write a program that would move all my video files into folders based on their video playback size.
I was thinking about having it organized like this.
/HD/1080p/(FileName)/(fileName).ext
/HD/720p/(FileName)/(fileName).ext
(I know that not all video files are 1080 or 720p because of crop, but within +-20 to 30px.)
/SD/(FileName)/(fileName).ext //anything less then 720p
I know you are able to right click on a video file and go to properties then details and see the frame width and frame height, but I'm not sure you can view this information in C#.
I don't know where to start and some information would be awesome. like:
Moving files with c#, renaming them, Viewing file details (frame sizes, file type, name, lenght, etc.) I plan on making a DB on this information but as of right now I just want to move the files into the correct folders.
I have been doing this manually and it's very tedious and time consuming.
Any help would be awesome, Thanks,
Throdne
The best for getting file info properties is to use MediaInfo.dll. There is also c# wrapper available to collect all data you need from video file.
You can obtain media ifo from mediainfo.sourceforge.net
This is multiplatform and can be used on Mono and Linux as well on Windows.
I've put also some information about MediaInfo on following thread: https://stackoverflow.com/questions/9561490...
Your best bet is using something like DirectShow which will handle multiple video formats there is a com+ object you can attach to but on source forge there is a wrapper around the
API
Info on sourceforge
once you have that figured out you can then go
here to figure out how to move files around

Playing an MP4 in a zip file through a network location

I'm building a video system, and have came across a problem of accessing a video held in a remote location. Now predicament is that I don't want to mess around with the zip file by extracting the data, this would take too long from a user perspective and would rather be able to open video file directly from within side the zip. My question is, is this possible? The ability to open a file is not something I've found within the DotNetZip library.
The only solution I've found is pointing VideoLAN at the zip file and playing it from there. However, doing this programmatically is something I'm massively struggling with, through the VideoLan DotNet for WinForm & WPF C# plugin and it's lack of examples. Just wondering is there any alternative means?
Why dont you use the VLC ActiveX Directly ,just import the AxVlc.dll to you're project ,than you can select the VLC Plugin from Toolbox in VS (VLC Plugin v2 prefered).
Than you can do something vlc.playlist.add("FileName",Null,""); than use vlc.playlist.play(); version's under 0.9.9 works with Loop ,new version's you should build the Loop Function by you're self.
What's the reason of compressing video files? They are already compressed, and far better than zip can do.

Categories