|
Can any tell me how to start programming or reading of display drivers (xp or vista )any link or any tutorial or any forum where i can get help. i dont have any basic knowledge of drivers too.
thanx
prashant jain malviya national institute of technology
|
|
|
|
|
What exactly are you trying to do ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello, I'm not exactly certain that this is the riht place to post this. If I am wrong, could someone please redirect me?ve never done graphics programming,
Anyhow, here's my question. What can I use to print graphics to the screen in Unix with C++? I'm rather restricted on platform and compiler choice, but other than that I'm free to do what I want. I'm telnet-ing into a unix server, so I don't know if that will affect my ability to download libraries like OpenGL.
I've never done graphics programming so everything here is somewhat new to me. If I can gain to draw and move bitmaps on the screen it will be enough.
Thanks to anyone who helps or at least pushes me in the right direction.
|
|
|
|
|
MartyExodus wrote: What can I use to print graphics to the screen in Unix with C++?
MartyExodus wrote: I'm telnet-ing into a unix server, so I don't know if that will affect my ability to download libraries like OpenGL.
1st off if you are executing via telnet, you are stuck with Xwindows. OpenGL doesn't remote well. 2nd I wouldn't recommend installing OpenGL into a Unix box unless you have full control over that box, A) I doubt it is possible without root access and B) it's not for the faint hearted.
MartyExodus wrote: If I can gain to draw and move bitmaps on the screen it will be enough.
That definitely sounds simple enough to be an X-windows job. http://trolltech.com/products/qt[^] will let you use Xwindows as a front-end and they have some bitmap manipulation routines as well as 2D drawing. OpenGL will take you beyond that stage into 3D textured environments multi-frame rendering and complex 3D shapes with rotations.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Be kind please.
The simple C# program below runs correctly until it encounters a "generic error in GDI+" exception. This seems to happen about 500 images into the list, regardless of the actual image data. I have several questions here, insight to any are appreacited. My intent is to use the GDI+ routines to get basic image properties (width and height) from directories containing images. I can't find any smoking gun in the exception data. The error code is -2147467259. Thanks in advance for any direction.
Q1) What is really going wrong here? I can catch the execption, but I don't know what to do with it.
Q2) Correctness and functionality is more important; but isn't there a more efficicent way to do this without a creating a new Bitmap object inside the inner loop?
<code>
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace ListFiles1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This program lists all the files in the directory");
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"c:\image");
foreach (System.IO.FileInfo file in dir.GetFiles("*.jpg"))
{
Bitmap myBitmap = new Bitmap(file.DirectoryName + @"\" + file.Name);
Console.WriteLine("{0}, {1}, {2}, {3}",
file.Name, file.Length, myBitmap.Width, myBitmap.Height);
}
Console.ReadLine();
}
}
}
</code>
|
|
|
|
|
Hi,
are you sure it is 2147467259 and not -2147467259 ???
that one equals 0x80004005 which is simply good old E_FAIL
GDI+ is very good at error handling, everything is called "general error" and
the error number does not tell anything.
In your case you are running out of memory.
Didn't they tell you you should Dispose of all objects you no longer need when
such objects are instances of a class that offers a void Dispose() method ?
You are polluting your entire system!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: In your case you are running out of memory.
Didn't they tell you you should Dispose of all objects you no longer need when
such objects are instances of a class that offers a void Dispose() method ?
I guess I am naive to think that C# garbage collection would "just work". More likely this is my problem for using GDI+ within C#. So the challenge for me remains to either:
a) Reuse a single instance of myBitmap.
b) Invoke the Dispose() method so too many objects don't overrun the heap.
I'm not sure I know how to do either, but will try.
|
|
|
|
|
Getting a mysterious error message is a good indication naivety has to be scaled back.
Invoking a method with no parameters and no return value is rather easy, reusing a
Bitmap does not sound like a good idea.
ss42a wrote: I'm not sure I know how
Then that's why they invented "documentation", available under either MSDN or Google.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The next likely cause for a GDI+ general error is a bad image file.
Suggestion: log the files one by one before creating the new Bitmap and/or
show the filename in the catch construct.
The (last) one shown is the suspicious one; try loading just that one; or try
double-clicking it.
BTW: IIRC GDI+ can't handle 1-bit-per-pixel images.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you!
It turns out that some JPEG image files; which look fine as thumnails, display correctly; may have some kind of defect that causes GDI+ to throw an error. This is good, since I'm using the try/catch blocks to isolate them. Thank you for your help.
Below is the modified code which works fine; but coughs up an occasional image file that may look fine, but has some internal defect that confuses the GDI+ decoder.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Drawing;<br />
<br />
<br />
namespace ListFiles1<br />
{<br />
class Program<br />
{<br />
<br />
static void Main(string[] args)<br />
{<br />
<br />
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"c:\image");<br />
<br />
foreach (System.IO.FileInfo file in dir.GetFiles("*.jpg"))<br />
{<br />
<br />
try<br />
{<br />
Bitmap myBitmap = new Bitmap(file.FullName);<br />
Console.WriteLine("{0}, {1}, {2}, {3}", file.Name, file.Length, myBitmap.Width, myBitmap.Height);<br />
myBitmap.Dispose();<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine("*************** Exception Caught for {0}", file.FullName);<br />
Console.WriteLine(e.Message);<br />
}<br />
<br />
}<br />
Console.WriteLine("Any character to exit...");<br />
Console.ReadLine();<br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
Hi there!
Is there any way to figure out the video file width and heigth before loading it using vmr9 or other filters?
Thanks in advance,
Andrew
|
|
|
|
|
Hi
you want the video width height through a filter wether vmr9 or any othr,then note that a Directhow Filter only returns the data when it will receive a MediaSample.
|
|
|
|
|
Hello,
I'm using C++ Builder 2007 prof. from Borland. I will make my own icon's but I can't find my Image Editor. Can sombody help my were I find them. It's not on the CD or. I have the program full instalt.
Jelle.
|
|
|
|
|
While there may be some Builder users here, this is a Visual C++ board,
so you may also want to ask on a Borland-centric board as well
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
can any one help me to solve this problem i am a new leaener to direct show.
i have created custom filetrs and pins and connected them but why it is not able to play the file.
After compiling its not giving any error and running successiflly. but it is not rendering. can any one help me..
here is the code.
/*
BuildingFilter.cpp
This program is to create our own filters
*/
#include <DShow.h>
#include <InitGuid.h>
#include <dmo.h>
//#include <dmoimpl.h>
#include <dmodshow.h>
//audio filters defined
#define INITGUID // have to define this so next line actually creates GUID structure
DEFINE_GUID(CLSID_WmAudioDecoderDmo,0x2eeb4adf, 0x4578, 0x4d10, 0xbc, 0xa7, 0xbb, 0x95, 0x5f, 0x56, 0x32, 0x0a);
DEFINE_GUID(IID_IDMOWrapperFilter,0x52d6f586,0x9f0f,0x4824,0x8f,0xc8,0xe3,0x2c,0xa0,0x49,0x30,0xc2);
//DEFINE_GUID(CLSID_WmAudioDecoderDmo,0x874131cb, 0x4ecc, 0x443b, 0x89, 0x48, 0x74, 0x6b, 0x89, 0x59, 0x5d, 0x20);
DEFINE_GUID(CLSID_WMVVideoDecoder, 0x4A69B442, 0x28BE, 0x4991, 0x96,0x9C, 0xB5, 0x00, 0xAD, 0xF5, 0xD8, 0xA8);
//DEFINE_GUID(CLSID_WmVideoDecoderDmo,0x82d353df, 0x90BD, 0x4382, 0x8b, 0xc2, 0x3f, 0x61, 0x92, 0xB7, 0x6e, 0x34);
void main(void)
{
IGraphBuilder* g_pGraphBuilder = NULL; // assume graph builder already created
IBaseFilter* g_pSource = NULL; //source filter
IBaseFilter* g_pVideoRender = NULL; //video render
IBaseFilter* g_pAudioRender = NULL; //sound render
IFileSourceFilter* pFileSourceInt = NULL;
IBaseFilter *pDmoFilter = NULL;
IBaseFilter *pDmoFilterV = NULL;
IDMOWrapperFilter *g_pAudioParser;
IDMOWrapperFilter *g_pVideoParser;
HRESULT hr;
IMediaControl *gControl = NULL;
IMediaEvent *gEvent = NULL;
IEnumPins* EnumPins = NULL;
IPin* OutPin = NULL;
IPin* InPin = NULL;
ULONG fetched;
PIN_INFO pinfo, pinfoVideoParser, pinfoVideoParserOut, pinfoVideoRenderer;
IEnumPins* EnumPinsV = NULL;
IPin* OutPinV = NULL;
IPin* InPinV = NULL;
ULONG fetchedV;
PIN_INFO pinfoV;
long evCode=10;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL,CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void **)&g_pGraphBuilder);
hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)&gControl);
hr = g_pGraphBuilder->QueryInterface(IID_IMediaEvent, (void **)&gEvent);
CoCreateInstance(CLSID_WMAsfReader, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pSource);
//CoCreateInstance(CLSID_WmAudioDecoderDmo, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pAudioParser);
//CoCreateInstance(CLSID_WmVideoDecoderDmo, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pVideoParser);
CoCreateInstance(CLSID_DSoundRender, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pAudioRender);
CoCreateInstance(CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)&g_pVideoRender);
// Create the DMO audio Wrapper filter.
hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, reinterpret_cast<void**>(&pDmoFilter));
pDmoFilter->QueryInterface(IID_IDMOWrapperFilter, (void **)&g_pAudioParser);
g_pAudioParser->Init(CLSID_WmAudioDecoderDmo, DMOCATEGORY_AUDIO_DECODER);
g_pAudioParser->Release();
//add DMO audio filter to the filter graph.
g_pGraphBuilder->AddFilter(g_pSource,NULL);
g_pGraphBuilder->AddFilter(pDmoFilter ,L"Audio transfer");
// Create the DMO video Wrapper filter.
hr = CoCreateInstance(CLSID_DMOWrapperFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, reinterpret_cast<void**>(&pDmoFilterV));
pDmoFilterV->QueryInterface(IID_IDMOWrapperFilter, (void **)&g_pVideoParser);
g_pVideoParser->Init(CLSID_WmAudioDecoderDmo, DMOCATEGORY_VIDEO_DECODER);
g_pVideoParser->Release();
//add the DMO video wrapper filter.
g_pGraphBuilder->AddFilter(pDmoFilterV ,L"Video transfer");
// g_pGraphBuilder->AddFilter(g_pVideoParser, NULL);
g_pGraphBuilder->AddFilter(g_pAudioRender,NULL);
g_pGraphBuilder->AddFilter(g_pVideoRender,NULL);
hr = g_pSource->QueryInterface(IID_IFileSourceFilter, (void**)&pFileSourceInt);
hr = pFileSourceInt->Load(L"C:\\Documents and Settings\\amiyakumar.d\\My Documents\\Jog_Top-Down_View\\video.wmv",NULL);
if( hr == E_FAIL)
printf("\n Failed to open the file\n");
// find 2 source output pins
g_pSource->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPin, &fetched); //1 pins for source audio
OutPin->QueryPinInfo(&pinfo);
EnumPins->Next(1, &OutPinV, &fetched); //1 pins for source video
OutPinV->QueryPinInfo(&pinfoV);
/*
// find audio parser input
pDmoFilter->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if(pinfo.dir == PINDIR_OUTPUT)
{
InPin->Release();
EnumPins->Next(1, &InPin, &fetched);
}
//connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
//pinfo.pFilter->Release(); // make sure you release the returned IBaseFilter interface
//pinfoV.pFilter->Release();
if (pinfo.dir == PINDIR_INPUT) // check if we have wrong pin (not input pin)
{
OutPin->Release();
EnumPins->Next(1, &OutPin, &fetched); // if so, get next pin
}
EnumPins->Release();
// find audio parser output
pDmoFilter->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if (pinfo.dir == PINDIR_INPUT)
{
OutPin->Release();
EnumPins->Next(1, &OutPin, &fetched);
InPin->QueryPinInfo(&pinfo);
}
EnumPins->Release();
// find audio render input
g_pAudioRender->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPin, &fetched);
InPin->QueryPinInfo(&pinfo);
pinfo.pFilter->Release();
if(pinfo.dir == PINDIR_OUTPUT)
{
InPin->Release();
EnumPins->Next(1, &InPin, &fetched);
}
// connect
g_pGraphBuilder->Connect(OutPin, InPin);
InPin->Release();
OutPin->Release();
*/
// find video parser input
pDmoFilterV->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPinV, &fetchedV);
InPinV->QueryPinInfo(&pinfoVideoParser);
//pinfoVideoParser.pFilter->Release();
/*
if(pinfoVideoParser.dir == PINDIR_OUTPUT)
{
InPinV->Release();
EnumPins->Next(1, &InPinV, &fetchedV);
}
*/
// connect
g_pGraphBuilder->Connect(OutPinV, InPinV);
//InPinV->Release();
//OutPin->Release();
// find video parser output
pDmoFilterV->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &OutPinV, &fetchedV);
OutPinV->QueryPinInfo(&pinfoVideoParserOut);
while(pinfoVideoParserOut.dir == PINDIR_INPUT)
{
EnumPins->Next(1, &OutPinV, &fetchedV);
OutPinV->QueryPinInfo(&pinfoVideoParserOut);
}
//pinfoVideoParserOut.pFilter->Release();
// find video render input
g_pVideoRender->EnumPins(&EnumPins);
EnumPins->Reset();
EnumPins->Next(1, &InPinV, &fetchedV);
InPinV->QueryPinInfo(&pinfoVideoRenderer);
//pinfoVideoRenderer.pFilter->Release();
/*
if(pinfoVideoRenderer.dir == PINDIR_OUTPUT)
{
InPinV->Release();
EnumPinsV->Next(1, &InPinV, &fetchedV);
}
*/
// connect
g_pGraphBuilder->Connect(OutPinV, InPinV);
//InPinV->Release();
//OutPinV->Release();
// hr = g_pGraphBuilder->QueryInterface(IID_IMediaControl, (void **)&gControl);
// hr = g_pGraphBuilder->QueryInterface(IID_IMediaEvent, (void **)&gEvent);
hr = gControl->Run();
gEvent->WaitForCompletion(INFINITE, &evCode);
hr = gControl->Stop();
gControl->Release();
gEvent->Release();
pFileSourceInt->Release();
g_pAudioRender->Release();
// g_pVideoRender->Release();
// g_pAudioParser->Release();
// g_pVideoParser->Release();
g_pSource->Release();
g_pGraphBuilder->Release();
CoUninitialize();
}
amiya kumar das
|
|
|
|
|
Hello,
I wonder if anyone out there has some experience in using color management with GDI+?
Specifically, when retrieving pixels from a GDI+ Bitmap using the LockBits/UnlockBits methods with a BitmapData object, should I assume that the RGB values in the BitmapData scan0 buffer are in linear light RGB space or gamma corrected RGB space? If gamma corrected, what white point/specific RGB space is used? Does it depend on how the Bitmap was constructed? Here are specific situations I need to know about:
- If a GDI+ Bitmap is constructed using one of the methods that indicates embedded color management will be used, such as Bitmap::Bitmap(const WCHAR *filename,BOOL useIcm), how does that Bitmap apply color correction when useIcm is set to TRUE? Does it hand me gamma corrected RGB values in the BitmapData scan0 buffer, or linear light RGB values? What does it hand me if useIcm is set to FALSE?
- If I later pass new data to the Bitmap above (constructed with useIcm = TRUE), using my own buffer and the ImageLockModeUserInputBuf flag, do I have to do my own gamma correction? That is, will the Bitmap object assume my data is linear RGB or gamma corrected RGB?
- If I then draw the Bitmap to the screen or to a printer with a Graphics object constructed using Graphics::Graphics(HWND hwnd, BOOL icm), with icm set to TRUE, does the Graphics object expect the data in the Bitmap object to be gamma corrected or linear RGB? With what white point? Does it depend on how the Bitmap was constructed? What if the Graphics object was created with icm set to FALSE? What if either the Bitmap or the Graphics object uses ICM, and the other doesn't?
- If I now use one of the Graphics::DrawImage methods with an ImageAttributes object, is the RGB data in the Bitmap object assumed to be in linear RGB? How do all these things interact?
Excuse me if there is already documentation on this somewhere, but I have been unable to find it. I would very much like to know if there is some comprehensive documentation somewhere about how GDI+ uses ICM.
Any information would be appreciated, but especially on the topic of what to do when passing my own pixel buffer to a Bitmap object using a BitmapData object with the ImageLockModeUserInputBuf flag set. Do I have to do all the color management on the data myself in that case? Or would that cause problems because the Bitmap expects to do that itself?
Thanks for any help you can give.
|
|
|
|
|
plz can someone help me to get a FREE version of infragistics NetAdbantage for .Net from onother source of "www.infragistics.com" ?
|
|
|
|
|
Hi how do create fonts in font lab. Are there a step by step instructions I can follow?
|
|
|
|
|
I have no idea where you got the idea that this site supports FontLab. Try a better source of information on it, like this[^].
|
|
|
|
|
|
Mark Salsbery wrote: CodeProject - Your Visual Studio and .NET Resource - and Typography?
CodeProject Atlas -- Supporting the world since 2007
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I'm experimenting with DirectX but am having trouble finding free software to create model(.x) files.
If anyone knows of any good free software (yes i'm a poor student, so I can't afford professional stuff) I'd love to know about it.
I do have access to Solidworks (2006 SP4.1), none of the lecturers round here seem to know if you can make .x files with it?
Can anyone help me?
Mark.
|
|
|
|
|
MarkBrock wrote: I'm experimenting with DirectX but am having trouble finding free software to create model(.x) files.
http://www.blender.org/features-gallery/features/[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Thanks heaps!
that's exactly what I've been looking for .
Mark.
|
|
|
|
|
MarkBrock wrote: that's exactly what I've been looking for
Its a good product, but it is not alone, so if you find something it can't do, ask. There are about half a dozen free modelers of various quality, more so than half a dozen in the low quality area (or too young to know). There are translators, and various processing/modifiers to do things blender does not.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|