Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Printing jpeg/gif files

Posted on 2000-04-18
5
222 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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