Solved

Printing jpeg/gif files

Posted on 2000-04-18
5
223 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Title # Comments Views Activity
xyBalance chalenge 58 102
Pressing cancel button with C# UI Automation 3 90
bigDiff challenge 17 133
Detect file exist or not 3 198
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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