How can I display external jpg or gif images in my program?
How can I display external jpg or gif images in my program?
that's a kind of vague question. Maybe use an image control.
>>that's a kind of vague question
[vague answer]
GDI+
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
VAGUE??????? jpg-s and gif-s are SPECIFIC image types, if I would ask how to display images, that would be VAGUE question.
Here is an example of using a list-view as an image box which will support JPEG and GIF images. Other options include OleLoadPicture and GDI+.
>How can I display external jpg or gif images in my program?
>VAGUE??????? jpg-s and gif-s are SPECIFIC image types
There are other considerations....
MFC or WIN32?
.NET or VC 6?
Double buffering?
Using a control ie button?
ect......
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
But I got the point from anonytmouse's link already...
One question Is there anyway to make it internal i would hate to constantly move JPG files, along with the program, isnt there a way to compress it into the EXE or put it in some sort of compressed file and easily extract it? like a CAB or something? Or maybe somehow attached to the EXE???????
Yes, you can embed the gif in a resource file and use the following to retrieve it:isnt there a way to compress it into the EXE
FindResource
LoadResource
LockResource
An example of a resource entry would be as follows:
Finally, I would use IPicture to display the image.Code:IDB_MYPIC BINARY "res\\mypic.gif"
Please don't bump old threads. Just create a new thread and include a link to the thread you need to reference.Originally Posted by execute
Originally Posted by kermi3
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.