• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

using the Intel® JPEG Library v1.51

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
Malek103197
Asked:
Malek103197
  • 3
  • 2
1 Solution
 
Malek103197Author Commented:
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
 
mdouganCommented:
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
 
mdouganCommented:
ps, I'm not sure if it's important, but I set the AutoRedraw property of the picture box to true.
0
 
Malek103197Author Commented:
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
 
Malek103197Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now