|
Evil_Inside01 wrote: (it reads the path from a listview item)...
Have you verified that it is correct?
Evil_Inside01 wrote: ...the program crashes
Which means what?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
ive fixed the error
thanks for helping
|
|
|
|
|
i is an integer holding an 8 bit value of a joysticks position. How do i get an emulator on my pocket pc to see it as an input/button press?
|
|
|
|
|
Try the Mobile Development forum [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I'm writing an MFC application that has headings of anti-aliased text in dialogs that are CStatic pictures (bitmaps). They appear against another flat coloured CStatic that has it's color set to "Gray" - the actual shade of gray varies, based on the windows style - a unique shade for windows classic style, windows XP style, or windows Vista style. I could just make the background of the overlaid, anti-aliased text the same as the colour of the flat "gray", but, as I've said, the exact color varies.
What can I do to achieve the desired effect of having an image of anti-aliased text overlaid over the variable "gray", looking correct in all possible scenarios? GDI+ looks interesting, but I can't find a codeproject project that does what I've described.
Thanks in advance,
Sternocera
|
|
|
|
|
Are the bitmaps composed programatically or with an image editor?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
They are simple bitmap files, composed with an image editor,
Regards,
Sternocera
|
|
|
|
|
If you create the bitmaps with a transparent background and save them
in a format that preserves alpha channel info (e.g. PNG) then you can use
GDI+ to easily render the images on any background.
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap *srcBitmap = new Gdiplus::Bitmap(L"c:\\some.png", FALSE);
Gdiplus::Graphics g(hwnd, 0);
g.DrawImage(srcBitmap, 0, 0);
delete srcBitmap;
Gdiplus::GdiplusShutdown(dwToken);
}
You could also use GDI+ to compose a bitmap programatically.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
Thanks for that. It would be preferable to have a CStatic inheriting class that encapsulated all of this GDI stuff from me, or perhaps worked in a different way, and allowed me to use resources, because the images's(currently a CStatic) position is currently dictated by a third party class that changes the position of widgets as the application's main window is resized, to keep their relative position - I need to maintain this.
All I want is a CStatic with dithered transparency - Is there a more expedient way to get this effect?
Regards,
Sternocera
|
|
|
|
|
Sternocera wrote: It would be preferable to have a CStatic inheriting class that encapsulated all of this GDI stuff from me
You can do the rendering from anywhere you want.
Instead of GDI+, you could create the bitmaps with a background of a certain color
like RGB(0x00,0xFF,0x00). That color can then be used in the TransparentBlt() API
to render a bitmap or to create a masked imagelist from the bitmap which can be rendered
on the control.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
That sounds like a good solution. I'll investigate it. Thank you very much,
Sternocera
|
|
|
|
|
I have a class which has 2 access functions thus:
std::vector<const MyClass *> Function() const;
std::vector<MyClass *> Function();
and I am trying to do an assignment from another non const member function of the class like this:
std::vector<const MyClass *> variable = Function();
By default the compiler always tries to use the non const access function and gives me a type mismatch. Is there any way apart from creating a temporary const pointer to myself to force the compiler to resolve to the correct const version of the function which returns the correct type?
If you vote me down, my score will only get lower
|
|
|
|
|
This is how I attempt to do that for subscript operators...
CSomeObject& operator [](int nSubscript);
const CSomeObject& operator [](int nSubscript) const; // Readonly subscript operator
I'm not sure if this will work in the context you provided but it's worth a shot. Got this out of "Professional C++, by Solter and Kleper" Page 446 (Providing Read-Only Access with operator[])
|
|
|
|
|
Hi,
I' need to perform a conversion from wav file to double array. In particularly I'd like to catch only the chunk relative to data information (I would to filter out any info about bitrate, frequency,etc).
How can I do this?
Thank in advance.
|
|
|
|
|
Parse the WAV[^] file, and for each sample, convert the sample to a
double.
Which part of that are you having trouble with?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
have a look at this[^] for a description of the WAV format.
You will need to read in the different headers to know where and how to read the data "chunk"; then, simply read and
add each "sample" to you array, be carefull of the left and right channels.
AFAIK (and understand it), the sample is not a double value.
|
|
|
|
|
Visual C++ 2003, MFC, Doc/View...
I have a need to ensure the CView::OnPaint method and subsequently the CView::OnDraw gets called in certain situations, even without an invalid region. According to the documentation, RDW_INTERNALPAINT should be used within a RedrawWindow() call to force at least one WM_PAINT regardless of whether an invalid region exists or not.
This seems to work only when RDW_INTERNALPAINT|RDW_UPDATENOW are combined. However, I don't want to force the refresh immediately, it would be better to allow the message to be processed in it's normal fashion so I'd rather not use RDW_UPDATENOW.
If I use RDW_INTERNALPAINT by itself, the CView::OnPaint never gets called. What am I doing wrong?
|
|
|
|
|
I bought 16 channel video card that i want to use to build a surveillance system. The software that the company provides is pretty much overkill for what i want use it for. Also the package weighs in at 2gb and doesn't have any option to install only the components that i need. I'd like to develop my own software to communicate with this card directly. Does anyone know if it would be possible?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
teejayem wrote: I'd like to develop my own software to communicate with this card directly. Does anyone know if it would be possible?
Doesn't the fact that the card is delivered with software for communicating with it answer your question?
You may consider item #2 in the list provided in this post[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
The software is a separate download. All i want to make is a viewer and i don't think i should have to install a 2gb file (that probably expands to 4gb) just to use their viewer.
As far as your item #2 comment, I don't believe that i asked anyone to provide me with any code for my question. I simply asked if there was a way to communicate with the hardware if the drivers were installed on the machine. How much more specific do i need to be?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Does the hardware company offer a 3rd party development. kit ?
|
|
|
|
|
yeah they do however, they only provide video streaming through tcp/ip to a server they provide.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
teejayem wrote: As far as your item #2 comment, I don't believe that i asked anyone to provide me with any code for my question.
No, you did not. But item #2 says "be specific".
teejayem wrote: I simply asked if there was a way to communicate with the hardware if the drivers were installed on the machine. How much more specific do i need to be?
It depends on how specific answer you'd like.
Given the information you've provided so far my answer can only be "yes, it's possible".
Of course you'll need to know "how" to communicate with the card, what protocol it uses and so on. But you didn't provide any info that can be used to guide regarding this. Perhaps you can find it in the documentation for your card.
Somehow I find it hard to believe that you want a simple 'yes' or 'no' to be able to continue your work to the question "if it's possible".
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
If the drivers are installed then you could try out some video capture program to see if it can use those drivers (i think you can try Media Player Classic to open capture devices for input) and if you can then it is possible to write your own progrqm using DirectShow, PROBABLY.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thanks for the info. I'll test this out.
Don't be overcome by evil, but overcome evil with good
|
|
|
|