Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Printing jpeg/gif files

Posted on 2000-04-18
5
Medium Priority
?
234 Views
Last Modified: 2013-11-20
Hi friends,
 I want to print jpeg/gif files from a dialog application.
 I tried the ShellExecute(Hwnd,"print",filename,NULL,NULL",SW_HIDE) command.it's printing only bmp files.
Hwnd - handle to window which i set it as NULL.
How do you set the handle to a window in a dialog application and also how do U save the contents of a window in a dialog application.
I am very thankful to any kind of help you provide.





 
0
Comment
Question by:mohit_rao
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 20 total points
ID: 2727660
Windows doesn't natively understand GIF or JPEG files. You'll need to get a library to convert the files to bitmaps, then print the bitmaps. You can do that all in-memory, without writing a file and spawning another program.

There are dozens of shareware and freeware image format decoding routines avaialble--just search the web. http://www.codeguru.com/ is a site that has many.  Search with your favorite engine for "JPEG" and "C Source", too.

..B ekiM
0
 

Author Comment

by:mohit_rao
ID: 2729354
i would want a more elaborate answer than this, how would u achieve this in memory (would you save any jpeg/gif files as .bmp before printing with shellexecute ? ),thank u very much for ur help and i will surely have a look at codeguru.com for the c source
thank you
Mohit.M
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2729413
> i would want a more elaborate answer than this,

Then, you'll need to offer more than 10 points.

 > memory (would you save any jpeg/gif files as .bmp before
 > printing with shellexecute ?

No.  Like I said, you're doing it all in memory--there's no need to write a file, and no need to spawn another process. All that stuff is just going to slow your program waaay down.

..B ekiM


0
 

Author Comment

by:mohit_rao
ID: 2729501
I am ready to 50 points mike
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2729547
> I am ready to 50 points mike

To me, it sounds like you want a code sample. I won't write a sample for less than 100 points. If you want me to write a sample, you'll also need to identify the specific decoders you want to use.

Regardless of what happens, you'll need to open a new question: you accepted this answer, so this question is over.

..B ekiM
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question