Solved

Printing jpeg/gif files

Posted on 2000-04-18
5
219 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 10 total points
Comment Utility
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
Comment Utility
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
Comment Utility
> 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
Comment Utility
I am ready to 50 points mike
0
 
LVL 11

Expert Comment

by:mikeblas
Comment Utility
> 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now