Solved

using the Intel® JPEG Library v1.51

Posted on 2002-05-12
5
359 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now