Solved

Printing jpeg/gif files

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 85
Pressing cancel button with C# UI Automation 3 66
noX challenge 17 112
JQuery serialize and unserialize 8 77
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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 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

10 Experts available now in Live!

Get 1:1 Help Now