Solved

using the Intel® JPEG Library v1.51

Posted on 2002-05-12
5
414 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
[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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
In this Micro Tutorial viewers will learn the basic shortcuts and functions of Illustrator. The viewer will learn about the paintbrush tool, anchor points, font sizing, and more.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

730 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