Loading...

Transparency and (Rotate and Save) Issues

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Transparency and (Rotate and Save) Issues

Postby senthil » Fri Jul 06, 2007 9:10 am

Hi loic,

I am using 3.7.7 GDPicture Pro. Now i am having issues in image transparency, after rotate and save.

1. To set the image transparency, i am using following code.
lRGBWhiteColor = ogdpicImg.ColorGetARGBValueFromARGB(255, 255, 255, 255)
ogdstatus = ogdpicImg.SetTransparencyColorEffect(lRGBWhiteColor)
I am using jpeg file for this process.

2. Image Scattering Issue.
i) Scanned the image using "oGdPicture.TwainSetCurrentPixelType (TWPT_GRAY)".
ii) Save the image.
iii) Rotate the image.
iV) Again save the image
V) After this, some of the gray backgrounds of image get scattered.

Reply Soon.

Thanks and Regards,
Senthil
senthil
 
Posts: 22
Joined: Tue Jun 19, 2007 6:33 am

Postby Loïc » Wed Jul 11, 2007 12:57 pm

Hi,

Could you write me the code you are using to do that ?

I need to know what is the rotation you are using.

Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Rotate Isssue

Postby senthil » Thu Jul 12, 2007 3:21 pm

Hi Loic,

When i am scanning, i am setting gray background using oGdPicture.TwainSetCurrentPixelType (TWPT_GRAY) . After scanning , if i rotate and save the image, the gray background of image get fadded. But if i convert image to 24Bpp before rotate, background was not fadded. If i convert in to 24Bpp image size is increasing.

Reply soon. It is very urgent.


Code:

If oGdPicture.TwainOpenDefaultSource() Then
nImageCount = 0

oGdPicture.TwainSetHideUI (chkHideUI.Value)
oGdPicture.TwainSetIndicators (chkIndicator.Value)
If chkAutoBrightness.Value = 1 Then
oGdPicture.TwainSetAutoBrightness (True)
Else
oGdPicture.TwainSetAutoBrightness (False)
oGdPicture.TwainSetCurrentBrightness (HBrightness.Value)
End If

oGdPicture.TwainSetCurrentContrast (HContrast.Value)
oGdPicture.TwainEnableDuplex (chkDuplex.Value = 1)
oGdPicture.TwainSetAutoFeed (True) 'Set AutoFeed Enabled
oGdPicture.TwainSetAutoScan (True) 'To achieve the maximum scanning rate

oGdPicture.TwainSetCurrentResolution (200)
oGdPicture.TwainSetCurrentPixelType (TWPT_GRAY) 'Gray
oGdPicture.TwainSetCurrentBitDepth (1) ' 1 bpp

While oGdPicture.CreateImageFromTwain(Me.hWnd) <> 0
nImageID = oGdPicture.GetNativeImage
nImageCount = nImageCount + 1
Call ApplyImageFilters(nImageID)
'If chkPreview.Value = 1 Then Call DisplayNativeImage
If nImageCount = 1 Then
Call oGdPicture.TiffSaveAsNativeMultiPage(App.Path & "\multipage.tif", 4)
Else
oGdPicture.TiffAddToNativeMultipage (nImageID)
oGdPicture.CloseImage (nImageID)
End If
Wend

'Rotate 90 degree
oGdPicture.RotateAngle (90)

Call oGdPicture.SaveAsTiff(App.Path & "\multipage1.tif")

If chkPreview.Value = 1 Then Call DisplayNativeImage

oGdPicture.TiffCloseNativeMultiPage
oGdPicture.TwainCloseSource
MsgBox "Done !"
Else
MsgBox "can't open default source, twain state is: " & Trim(Str (oGdPicture.TwainGetState))
End If


Thanks and Regards,
Senthil
senthil
 
Posts: 22
Joined: Tue Jun 19, 2007 6:33 am

Postby Loïc » Thu Jul 12, 2007 3:47 pm

Hi,

You should replace this line

Code: Select all
oGdPicture.RotateAngle (90)

by this one

Code: Select all
Rotate(Rotate90FlipNone)



Or :
like you said, convert first the image to 24bpp, apply the rotation and convert it to 8bpp.


Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Rotate Isssue

Postby senthil » Fri Jul 13, 2007 7:41 am

Hi Loic,

In Xp system, without converting to 24Bpp, if i rotate and save the image, rotated image not get saved. So i am following the below procedure for rotate and save.

1. Getting the pixel of the image before rotation using oGdPicture.GetIntPixelFormat. ( In my sample it is 8Bpp)

2. Then convert the image to 24Bpp.

3. Rotate the image.

4. After rotation, convert the image to original pixel ( In my sample it is 8Bpp).

5. Save the image.

If i follow the above procedure. In XP System without fadding image, image get saved.

But same code, if i followed in win 2000 system,the gray background of image get fadded.

If i followed your suggestion (Rotate(Rotate90FlipNone)) also, same problem in win 2000.
Reply soon.

Thanks and Regards,
Senthil
senthil
 
Posts: 22
Joined: Tue Jun 19, 2007 6:33 am

Postby Loïc » Fri Jul 13, 2007 9:21 am

Senthil,

I don"t understand what's you mean by "the gray background of image get fadded"

Please, send me by mail a "good" image and the same as "faded" image,
Or give me a full code to reproduce this behaviour because the code you gave me is incomplete...

Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby senthil » Fri Jul 13, 2007 11:49 am

Hi Loic,

As you said, i sent the tiff images to support
Reply soon.

Thanks and Regards,
Senthil
senthil
 
Posts: 22
Joined: Tue Jun 19, 2007 6:33 am

Postby Loïc » Fri Jul 13, 2007 3:06 pm

Ok Senthil,

your problem will be solve into the next release (end of week).


Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Postby Loïc » Fri Jul 13, 2007 5:46 pm

You can download the last release now:
http://www.gdpicture.com/products/gdpic ... ctivex.php


Regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Rotate Isssue

Postby senthil » Tue Jul 17, 2007 8:52 am

Hi Loic,

Thanks for your reply.
Now i am using your latest version 3.8.
In this version, if i do the same operation, i am getting collapsed image as output. This problem is only in windows 2000, not in Windows XP. I am doing following steps.

1. Getting the pixel of the image before rotation using oGdPicture.GetIntPixelFormat. ( In my sample it is 8Bpp)

2. Then convert the image to 24Bpp.

3. Rotate the image.

4. After rotation, convert the image to original pixel ( In my sample it is 8Bpp).

5. Save the image.

But if i convert image pixel using 'oGdPicture.ConvertTo8BppQ', image is not getting collapsed.
But if i do the above steps in windows XP, image size is increasing more.


I will send the images to your email id (esupport@gdpicture.com) for your reference.

Reply soon.

Thanks and Regards,
Senthil
senthil
 
Posts: 22
Joined: Tue Jun 19, 2007 6:33 am

Postby Loïc » Wed Jul 18, 2007 9:28 am

Hi Senthil,

You foud a new strange bug.

Into the last 3.8.1 edition it is solve.

Best regards,

Loïc Carrère
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: Bing [Bot] and 1 guest