Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Image with Time & Date 1

Status
Not open for further replies.

Error7

Programmer
Jul 5, 2002
656
0
16
GB
I am using URLDownloadToFile to download sequential frames from a video server and save them as jpg images.
Ideally I would like to display the time and date on each image before saving the jpg's, complete with the time & date displayed.
The only way I can think of to achieve this is to load the image into a Picture Box, print the time and date onto the picture, save it as a BMP then convert it to a jpg with DIWriteJpg.
Does anybody know of a better way to do this?


[gray]Experience is something you don't get until just after you need it.[/gray]
 
Thanks for your efforts Mike, your code is superb, particularly with large font sizes, but with smaller sizes, 18p and down, the outline dominates the fill colour and reduces the clarity.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
>the outline dominates the fill colour and reduces the clarity

There are a number of ways of rectifying that using some pretty straightforward techniques.

One - change the stroke width
Two - draw the stroke first, than overlay a filled, unstroked copy on top

there are more complex tricks involving draw modes, antialiasing, etc, but I was just looking to demonstrate a simple solution.

 
It was an excellent demonstration, thanks.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
When all is said and done it is often clearer just to use a background rectangle behind the text anyway. Probably doubly so when using JPEG compression which can fuzz things up a lot.
 
For sub titles, a semi transparent grey rectangle is often used so you can still see essential detail behind it but no rectangle is acceptable in my book for say the main title of a movie or slide show.
 
You could always add a header or footer bar that does not obscure any of the original image. That gives space for other things in addition to a timestamp such as location, camera ID, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top