?
Solved

Writing file from clipboard

Posted on 2000-03-19
4
Medium Priority
?
240 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 400 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 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