Solved

Writing file from clipboard

Posted on 2000-03-19
4
235 Views
Last Modified: 2013-11-20
I am capturing video and copying it to the clipboard. I would like to take the image from the clipboard and save it as a certain file (say image.jpg). I want to do this at configurable intervals (say 5 frames per second). So, from the clipboard i want to rewrite the image.jpg 5 times per second with the different images available at those times on the clipboard.
 Thanx for any help
0
Comment
Question by:vernk
[X]
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
  • 2
4 Comments
 
LVL 3

Expert Comment

by:ghimireniraj
ID: 2633829
comment added just to get notified
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2634030
ghimireniraj> comment added just to get notified

No need to announce that, ghimireniraj. Just leave the box blank and submit the form with the checkbox marked and you'll be added.

But, what's your question, vernk? Are you just interested in finding code that takes the data on the clipboard and writes it out to a file?

..B ekiM
0
 

Author Comment

by:vernk
ID: 2634381
B ekiM,
 Yes......I want to take the image on the clipboard and write it out to a file.....in effect overwriting the file 5x a second.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 2647861
There's no standard Windows clipboard format for JPEG files. That's because Windows always uses bitmaps to represent graphical data. Even if the program that sources this data normally writes a JPEG file, it's still converting to a bitmap to get it drawn.

It's possible (though very unlikely--because there'd be no reason to do it!) that the program is actually putting a registered clipboard format up that contains raw JPEG data. You could get that and dump it.  But, I doubt that's what's happening. The clipboard is for exchanging data from one Windows program to another. A bitmap is far richer and more readily accepted as a target

So, your solution will be:

1) Open the clipboard

2) Get the formats. If CF_BITMAP isn't one of them, you can't get the data because it isn't in a format you can use.

3) Get the memory. Lock it. Reference it as a BITMAP structure.

4) Use a 3rd party bitmap-to-JPEG library to convert the bitmap to a JPEG

5) Write the resulting data.

I'm not really in a position to endorse products, but my favorite library for step #4 is Intel's JPEG Conversion Library. It's very fast, and quite easy to use.  Plus, it's well-supported and free.

..B ekiM
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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
Perl Awk Need Help 3 139
Pressing cancel button with C# UI Automation 3 92
tripleUp challenge 7 93
Use of condition with 'serial' in ansible 2 88
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…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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