Solved

using the Intel® JPEG Library v1.51

Posted on 2002-05-12
5
403 Views
Last Modified: 2013-11-19
I orignally used the following method to save (to disk) the image inside a picture box -

SavePicture picShowImage.Image, App.Path + "\New.bmp"

and then use -

BmpToJpeg App.Path + "\mypageNew.bmp", App.Path + "\mypageNew.jpg", 100
    DoEvents
   
Kill App.Path + "\mypageNew.bmp"
DoEvents

Where BmpToJpeg is a DLL, created by Miroslav Milak? - I downloaded from a site, but I forget which one.

I am getting an error when I save the jpg to a bmp, I think because the resultant bmp is quite large.

I have tried the Intel® JPEG Library v1.51 and it works fine - no error even with large jpg. But I want to draw some text on the jpg and then save the new jpg with this text written on it. Has anyone worked with the Intel® JPEG Library v1.51 and how to draw text on top of the image in the picbox and then save the new jpg with this text included?

0
Comment
Question by:Malek103197
  • 3
  • 2
5 Comments
 

Author Comment

by:Malek103197
ID: 7005601
You can download the sample app that uses the intel dll from - http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

All I need to do is to add some text to the image and use the dll to save it as a jpg.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 200 total points
ID: 7006144
If it's the same example that I had, then in the event

Private Sub cmdSaveStdPic_Click()

I had loaded the jpg into a picture box instead of to the Form's hdc, and then in the code below, I'm printing to the picturebox, and then, because all graphics routines like Print are actually written to the Image and not the Picture property, I'm copying the image into the Picture, and then calling the CreateFromPicture function.  If you want to position your text, you can set the pic1.CurrentX and pic1.CurrentY before the Print statement.  You can also set the forecolor to get whatever textcolor you want.

   pic1.Print Format(Now(), "mm/dd/yyyy hh:nn:ss AM/PM")
   pic1.Picture = pic1.Image
   c.CreateFromPicture pic1.Picture
0
 
LVL 18

Expert Comment

by:mdougan
ID: 7006145
ps, I'm not sure if it's important, but I set the AutoRedraw property of the picture box to true.
0
 

Author Comment

by:Malek103197
ID: 7008490
Hey, thanks for the tips. It works fine. My VB code will be running on the server and automatically
printing text to images and then over-writing the file. Initially I had a sharing violation when I opned the
jpg with IE, but now so far OK. I had to comment out the part of the code that "killed" the existing file.

Thanks
0
 

Author Comment

by:Malek103197
ID: 7009853
mdougan - why is it that I set the quality to 90, but when I save my jpg the size increases by 50% and the quality, compared to the original, gets degraded?
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

861 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