Support Center

Change image canvas size

Jeff Bireley Jun 30, 2011 10:19AM EDT

We need to scale an image (which we know how to do) but also to change the canvas (background) size to make the images a standard size (which then we're putting a watermark on).

Is it possible to change the canvas size of the image through ImageMan without distorting the image? I have read the documentation but didn't see anything that would seem to apply to this problem.

2 Data Techniques Responses and 2 Community Responses

Up 3 Rated Down
DTI Support  Data Techniques Employee Jun 30, 2011 10:22AM EDT

Hi Jeff,

Which version of ImageMan are you using ? ActiveX, DLL or .Net ?

Thanks,
John
DTI Support

Up -1 Rated Down
Jeff Bireley  Data Techniques Employee Jun 30, 2011 10:28AM EDT

It's the ActiveX version 7.20

Thanks so much for responding so quickly!

Up -2 Rated Down
DTI Support  Data Techniques Employee Jun 30, 2011 10:41AM EDT

Hi Jeff,

With the Version 7 ActiveX control you'll need to use two instances of the control, in one load the image you want to be the new background, in the 2nd load the image you want to place. In the 2nd control you can scale the image as needed, then once its the right size you'll need to use the Windows GDI BitBlt method to copy the image data from the 2nd control into the first control. You can get the hDC properties for each control to pass to BitBlt.

With the Version 8 ImageMan controls you could just use the Merge method instead of the BitBlt method saving you the code to call BitBlt but the end result would be the same.

Thanks,
John
DTI Support

Up 3 Rated Down
Jeff Bireley  Data Techniques Employee Jun 30, 2011 12:02PM EDT

Terrific! I can do that!

Thanks again for your help.

This question is closed to new answers.

Contact Us