Solved

Writing file from clipboard

Posted on 2000-03-19
4
231 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Importing  SSL Certificate into Firefox using GPO 28 202
repeateFront java challenge 31 92
Thin secure Windows 10 5 74
JQuery serialize and unserialize 8 48
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

914 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

22 Experts available now in Live!

Get 1:1 Help Now