Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
smallkeung  
#1 Posted : Thursday, December 2, 2004 10:52:00 AM(UTC)
smallkeung

Rank: Member

Groups: Member
Joined: 12/2/2004(UTC)
Posts: 3

Recently my boss needs me to write a program to resize a photo, then the resized photo will be keep and inserted into a Excel later.

i can sucessfully to use the graphic mill to resize a photo. In some photo viewer like Acdsee. it doesn't see any problem. (the photo can be resized into the size that i need)

if the resized photo insert into a Excel. The photo will be very big and need to resize again in excel, and the photo is not in scale. it seems wired. ( i also try to use the graphic processor 1.9 but it doesn't seems any problem)
i've been updated the graphic mill into the most updated version.

is it the bug in graphic mill or i miss some code... ?

Thanks you

my code is the following:

Code:
Dim obj_pic As New GraphicsMill.Bitmap

obj_pic.LoadFromFile "C:\test.jpg"
obj_pic.Formats.SelectCurrent "JPEG"
obj_pic.Formats.Current.EncoderOptions("JpegQuality").Value = 60
obj_pic.Transforms.Resize 400,300 , InterpolationModeHighQuality
obj_pic.SaveToFile "D:\test.jpg"


my working environment
Graphic mill 2.0.346
VB6 sp6
Excel 2000 sp3



Edited by user Monday, December 24, 2007 4:26:12 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Friday, December 3, 2004 3:16:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello,

What code you use to put the image into Excel?

If other viewers display the image resized, it means that Graphics Mill did resize it. So I can assume that there is a typo in the code you use, e.g. you try to load C:\test.jpg instead of D:\test.jpg...

Hope this helps.
smallkeung  
#3 Posted : Saturday, December 4, 2004 1:11:00 PM(UTC)
smallkeung

Rank: Member

Groups: Member
Joined: 12/2/2004(UTC)
Posts: 3

i'm not use VBA OR VB to insert photo. i used the insert picture function in EXCEL only
um......
in excel, you can see the picture information. if i need to resize the picture into 400 x 300 pixel. The Excel will show 400" x 300" but if iuse graphic processor 1.9 the size will much more smaller... 5.xx" X 4.xx"
Andrew  
#4 Posted : Monday, December 6, 2004 12:04:00 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
It seems you need to specify proper image resolution using HorizontalResolution and VerticalResolution properties of the Bitmap. It is likely original file has incorrect DPI values (namely 1), although it is typically = 72.

So before saving image to file, add these lines:

Code:

objBitmap.HorizontalResolution = 72
objBitmap.VerticalResolution = 72


Hope this helps.
smallkeung  
#5 Posted : Tuesday, December 7, 2004 10:25:00 AM(UTC)
smallkeung

Rank: Member

Groups: Member
Joined: 12/2/2004(UTC)
Posts: 3

Oh~~~
it works.

Thank You
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.