Adjusting on screen image

Discussions about document viewing.
Post Reply
varcarme
Posts: 40
Joined: Tue Feb 05, 2008 8:56 pm

Adjusting on screen image

Post by varcarme » Sat May 07, 2011 3:04 pm

I'm wanting to allow the user to make some adjustments to the on screen image (brightness / contrast etc) but I'm have a few difficulties getting the adjustments to appear without first saving and reloading the image.

Code: Select all


oImage = CREATEOBJECT("gdpicturepro5s.imaging")

oImage.SetLicenseNumber("1234") 

oImage.CreateImageFromFileICM("c:\xxx.jpg") 

oImage.SetBrightness(10)

x=oViewer.SetNativeImage(oImage.GetNativeImage)

&&& x always returns 2 (invalid parameter)

if I use iImage.SaveAsJpg("c:\zzz.jpg") then oViewer.DisplayFromFile("c:\zzz.jpg") it works but this is so much slower.

varcarme
Posts: 40
Joined: Tue Feb 05, 2008 8:56 pm

Re: Adjusting on screen image

Post by varcarme » Thu May 12, 2011 4:07 pm

Still can't get this to work I'm afraid....

I tried to use Viewer.DisplayFromGdPictureImage(Imaging1.GetNativeImage())

This also returns an error 2 (wrong parameter)

I've tried lots of different images but always get the same result.

I'm really confused :cry:

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Adjusting on screen image

Post by Loïc » Fri May 13, 2011 2:00 pm

Hi,

I can suggest this:

- Check oImage.GetNativeImage returns a value <> 0
- Check the oImage objects is created from the same library as oViewer

If you meet these 2 conditions, your code should work.

Kind regards,

Loïc

varcarme
Posts: 40
Joined: Tue Feb 05, 2008 8:56 pm

Re: Adjusting on screen image

Post by varcarme » Thu Jun 09, 2011 12:57 am

Thanks Loïc

I think it must have been an old viewer component I was using.

:oops:

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests