|
A great start is here (nVidia Developer Zone)[^]. There are a tonne of resources that will give you lots of great ideas. For fire and particle systems, check of their FX Composer[^]
Ultimately, many, many cool effects can be done with pixel and fragment shaders.
Hope that helps get you started.
Cheers,
Drew.
|
|
|
|
|
Thanks for the link
|
|
|
|
|
|
Has anyone have any resources (articles, algorithms, code etc) about how to flatten a hand-drawn line. I'll really appreciate it.
|
|
|
|
|
The Hough Transform is good for that. It can identify the position and slope of a line, even with errors in the data.
It considers each dark pixel as evidence the line passes through that point. As it process each dark pixel in the hand-drawn line, it accumulates evidence for all possible lines. The line with the most evidence is selected as the result.
(The Hough Transform can also recognize a lot more than just lines.)
A different (and simpler) approach is to use linear regression to get an equation of the line that best fits the points.
|
|
|
|
|
Another quick-n-dirty approach: Take the first and last point of the hand-drawn line, and find the equation of the line connecting them. Probably the simplest approach, which may be good enough for your purposes.
|
|
|
|
|
Thanks for the answer, I heard about the hough transform but never thought it could be the solution. Btw do you know any sample applications (or articles etc) that uses the hough transfrom for similar purposes, so I can examine it...
|
|
|
|
|
|
Hello gurus
trying to work on a bitmap I trapped into possible GDI+ limitations. In the help I find only a few formats that GDI+ supports (standards like BMP, JPG etc.) but not the format I need: DPX.
Is there any way to expand the possibilities and capture a DPX bitmap? I know there are some programs that can handle the format under windows, so I can't imagine there wouldn't be an elegant way...
Thanks in advance
Michael
|
|
|
|
|
If you only need a fixed number of DPX bitmaps, you can display them in whatever DPX viewer you have, select the image (left click), press Alt-PrtScn to copy the image to the clipboard, paste the image into MS Paint, then save the image as a bitmap file.
|
|
|
|
|
Unfortunately it's more often and I'll have to make an application which collects the relevant files and repairs them automatically.
If it's really not possible in VB Express direct, I guess I'm going to call GraphicsMagick (which btw does a great job in graphics transformations with almost every imaginable format) to repair image after image. Still I'd have loved to do it directly within the app...
Thank you anyway!
|
|
|
|
|
Hi,
I'm trying to retrieve the duration of an AVI file using Microsoft.DirectX.AudioVideoPlayback.Video class. This used to work on my previous XP machine, but on my new Vista machine its throwing a DirectXException
"Error in the application";
ErrorCode: -2147467262
ErrorString: "E_NOINTERFACE"
This exception is being thrown if I call the Video.FromFile method. Please help..
Thanks in advance,
Daniel
|
|
|
|
|
Do you know which technology that class uses under the covers? If it's VFW, that's not supported on Vista. Broke a bunch of OpenCV apps, too.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
You may need to install the latest DirectX runtime[^].
I'm not sure the managed DirectX stuff comes with Vista.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Without installing anything, references to the Managed DirectX libraries are available in VS2008 on Vista. I then installed the latest DIrectX SDK, but nothing changed.
No, I dont think its underlying technology is VFW. As far as I know, that evolved into DirectShow.
Is there any other way, which as easy as using the DirectX managed libraries to get the duration of an AVI file? Any harder solutions are also welcome ...
Thanks for your replies.
Daniel
|
|
|
|
|
AFAIK, managed DirectX isn't supported anymore but it is still
included as "extras" with the redistributable end-user run time.
If you can post the code that fails (it's just one missing interface, right?)
I will test it on the latest DirectX extras on Vista.
dwg1986 wrote: I dont think its underlying technology is VFW
No, it's not. DirectShow works with WDM drivers and can work with
legacy VFW devices.
dwg1986 wrote: Is there any other way
You can always parse the AVI info yourself... AVI RIFF File Reference[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for your reply. The code fails at runtime in the underlined line of code below:
using System;
using System;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.AudioVideoPlayback;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Test()
{
double dDuration = 0;
try
{
Video video = Video.FromFile("C:\\Test.avi");
dDuration = (video.Duration / 60);
}
catch (DirectXException dxEx)
{
MessageBox.Show(dxEx.Message);
}
}
}
The underlined line of code is where the DirectXException described in my original question is thrown.
Thanks again,
Daniel
|
|
|
|
|
I can confirm the error.
I can't confirm that Managed DirectX is supported on Vista.
It's not included in the latest DirectX SDK or the latest Platform SDK.
Do you have any links to info stating it's still supported?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Just for the heck of it, I tried the code on a WMV file...
It worked fine.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Wow, true.. it worked on a WMV.
I found a link which might hint some Managed DirectX issues on Vista: http://www.thezbuffer.com/articles/470.aspx[^], and other sites also hinted similar incompatbilities due to DirectX 10.
There is also mention of MDX.. but I have not yet a clue what it is exactly.
Still its strange it works on a WMV and not on an AVI.
|
|
|
|
|
I saw that link too. Not much mentioned about it during the
last year or two.
dwg1986 wrote: MDX.. but I have not yet a clue what it is exactly.
MDX == Managed DirectX I suppose
dwg1986 wrote: Still its strange it works on a WMV and not on an AVI.
Yeah - I wish I had the source code to see what the Video
class is using and what's missing on Vista!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh yeah.. MDX, Managed DirectX. *slaps himself* Damn was I tired.
So my options till now are:
1. Convert AVI library to WMV. No sense there.
2. Resort to some other third party SDK. (which I still have not found after hours searching)
3. No idea.
I'll post back if I get any success.
Thanks for all your help.
|
|
|
|
|
|
My Project required that I have to load the image from resource.
using Gdiplus::Bitmap::FromResource function , so I have to save the image in BMP format and it doesn't support alpha channel.
Are there anyway I can access the internal data of image after loading it so I can add alpha=0 to pixel that has particular color?
something like this psuedo code
for(int i=0;i<totalpixel;i++){>
if(pixel[i].r == pixel[i].g == pixel[i].b == 0){//if the pixel is black
pixel[i].a = 0;
}
}
thank in advance
modified on Friday, September 26, 2008 7:27 AM
|
|
|
|
|
Load the bitmap
Create a new Bitmap object with pixel format PixelFormat32bppARGB
Create a Graphics object from the new bitmap
Draw the original bitmap on the Graphics object
Use Bitmap::LockBits on the new bitmap to get direct access to the
pixel bits (the BitmapData struct has all the info you need to iterate
through the pixels)
Loop through the pixels setting alpha channel values as desired
Call Bitmap::UnlockBits on the new Bitmap
Dispose the Graphics object and the original bitmap
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|