?
Solved

using the Intel® JPEG Library v1.51

Posted on 2002-05-12
5
Medium Priority
?
449 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 800 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

Industry Leaders: 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
Suggested Courses

650 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