Source language: Translate to:

Scaling and Loading Image with hpwImage Control

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Scaling and Loading Image with hpwImage Control

Postby LauraMarie » Sun Jul 29, 2012 12:34 pm

I am atempting to load and scale an image to a rectange object.
After attaching the picture I would like to zoom image from inside the rectange. No image seems to attach but no errors are occuring. :(

Code: Select all
hpwImageCreate "importFrame" "" "" "" "" "" "" ""
GetObjectHandle "importFrame" "[FrameHandle]"
hpwGetObjRect "[FrameHandle]" "[X1]" "[Y1]" "[X2]" "[Y2]"
hpwImageScaleFromFile "importFrame" "[selectedFile]" "[X1]" "[Y1]" "[X2]" "[Y2]" "0" ""


What am I doing wrong?
My Current Project:
http://www.slideagent.com
User avatar
LauraMarie
 
Posts: 58
Joined: Sat May 05, 2012 8:02 am

Postby HPW » Sun Jul 29, 2012 1:42 pm

hpwImageScaleFromFile "importFrame" "[selectedFile]" "[X1]" "[Y1]" "[X2]" "[Y2]" "0" ""


Not sure if I understand it right.
hpwImageScaleFromFiles coordinates are relative to the created image.
So x=0 and y=0 will load the image to the top left corner.
The both other coordinates are the bottom right corner of the target area.

hpwGetObjRect gets screen coordinates.
So I do not get the idea why it is used in this context.

Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby LauraMarie » Sun Jul 29, 2012 2:08 pm

I thought that the image must be loaded into a host object (rectangle)?
I was getting the X and Y position to resize the image to the size of the rectangle.

I am looking to just resize an image from X to a specifed size.

So how is that done with your plugin?
My Current Project:
http://www.slideagent.com
User avatar
LauraMarie
 
Posts: 58
Joined: Sat May 05, 2012 8:02 am

Postby HPW » Sun Jul 29, 2012 10:02 pm

Take a look at the sample pub.
The four coordinates set the target area and scaling happens during loading it into that area.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 3 guests