|
gdi+ and/or freeimage
Kuphryn
|
|
|
|
|
I second that (GDI+ that is)
Wonderful little library for images and Font rendering. A little slow and kinda peculiar but you gotta love it.
|
|
|
|
|
|
Is there a way a program can command itself to run minimised.
After the program has started I want to send it a remote command to minimise itself and continue running.
|
|
|
|
|
::ShowWindow(hWnd, SW_MINIMIZE);
--
Coming Soon to an Illegal DVD
|
|
|
|
|
hi,
here is my weird question:
i defined a class:
Class CMyClass:: Public CWnd
...
then, i defined a function in another CPP file as threadproc.
UINT mythreadproc(LPVOID lpvoid)
{...
(CMyClass *) lpvoid;
...
}
and then, i tried to start the thread in a member function of CMyClass
CMyClass::Function1()
{
...
::AfxBeginThread(mythreadproc,this,THREAD_PRIORITY_NORMAL,NULL,NULL,NULL);
...
}
i used this because this thread just does some Drawing working periodically, and i want the lpvoid point to parent window so that i can ge the dc and client rect for drawing,
but the question is: i debugged the program, it seems the lpvoid is different from the "this " pointer point to the CMyClass object..what happened??
...
-- modified at 17:39 Tuesday 1st August, 2006
|
|
|
|
|
In MFC, you can't access certain kinds of objects from a different thread than the one that created the object. CWnd is one of those kinds. Also, doing GDI operations from a thread different than the one that created the window is not advisible because it will result in lots of context switches (and it may not even work at all in Vista with its new desktop composition).
The preferred way is to have the thread post a message to the window (post to the HWND , not the CWnd ) when drawing needs to be done. That way, the drawing happens on the UI thread.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hi, with assembler code embedded in my c++ code i'm trying to send a value to I/O port 0x43 (8254 timer control) but the program crashes at this point, i'm using digital mars c++ compiler wich has an inline assembler, also tried mingw and it's worst (it doesn't even compile), here are the asm lines:
asm
{
mov AL, 0xB6;
out 0x43, AL; // It crashes in this line.
mov AL, 54;
out 0x42, AL;
mov AL, 124
out 0x42, AL;
in AL, 0x61;
or AL, 0x3;
out 0x61, AL;
in AL, 0x61;
and AL, 0xFC;
out 0x42, AL;
}
I've also tried embedding this code into other languages like D, but it throws a win32 exception.
What's wrong man? thx
|
|
|
|
|
Does anyone know where I could find some good articles and examples on how to implement a Rice compression scheme in C++. The web has several articles but they seem to be for very specific cases.
Thanks.
|
|
|
|
|
How about this one?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Which one? sorry, I didn't get the link.
|
|
|
|
|
masnu wrote: I didn't get the link.
Check again. It's there.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
can u tell me about levis-derbin algorithm ?
http://www.engineeringproject.net
|
|
|
|
|
I don't know, but this[^] page may provide a starting point for your search.
/ravi
|
|
|
|
|
This may be a simple question, but I am writing a program that utilizes a pictureBox to show the currently selected picture. Below the pictureBox is a "Browse..." button that calls an openFileDialog. My question is, how to i get the picture selected to appear in the pictureBox. Or i guess a better question would be how to extract the path of the selected file from the openFileDialog so i can use it as I please.
Thanks in advance for any help.
|
|
|
|
|
Hope this helps....
Bitmap^ MyImage;
public:
void ShowMyImage( String^ fileToDisplay, int xSize, int ySize )
{
// Sets up an image object to be displayed.
if ( MyImage != nullptr )
{
delete MyImage;
}
// Stretches the image to fit the pictureBox.
pictureBox1->SizeMode = PictureBoxSizeMode::StretchImage;
MyImage = gcnew Bitmap( fileToDisplay );
pictureBox1->ClientSize = System::Drawing::Size( xSize, ySize );
pictureBox1->Image = dynamic_cast<image^>(MyImage);
}
-- OR --
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
Stream^ myStream;
OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
openFileDialog1->InitialDirectory = "c:\\";
openFileDialog1->Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
openFileDialog1->FilterIndex = 2;
openFileDialog1->RestoreDirectory = true;
if ( openFileDialog1->ShowDialog() == ::DialogResult::OK )
{
if ( (myStream = openFileDialog1->OpenFile()) != nullptr )
{
// Insert code to read the stream here.
myStream->Close();
}
}
}
Programm3r
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: // Insert code to read the stream here.
That's the part i am confused about
|
|
|
|
|
The lpstrFile member of the OPENFILENAME [^] structure passed to GetOpenFilename() contains this information.
/ravi
|
|
|
|
|
michmela44 wrote: ...I am writing a program that utilizes a pictureBox...
Isn't that just a static control?
Are you using MFC?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is GetOpenFilename() a member function of the openFileDialog?
Sorry for the question, but i am stuck at a place with limited bandwidth and can't really go hopping through the documentation.
|
|
|
|
|
It's a Windows Forms Application
|
|
|
|
|
No, it's a Win32 API call. See this[^] usage example.
/ravi
|
|
|
|
|
I assumed you were building a Win32/MFC application. You should have posted your question in the C#[^] forum.
In any case, use the FileName [^] property to obtain the name of the selected file.
/ravi
|
|
|
|
|
So rather than using an OpenFile Dialog, I create an OPENFILE structure and initialize, then call this->GetOpenFileName and this will open a dialog for me, and i can access the path of the file name if OK is clicked through lpstrFile.
Does that sound right?
|
|
|
|
|
Sorry. I just started using Visual Studio this week. I wasn't aware that I was using C# rather than C++. Thanks for all the help
|
|
|
|