Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

How to make image composition

Example requests & Code samples for GdPicture ActiveX.

How to make image composition

Postby Onier on Fri Jul 18, 2008 1:13 pm

I'm try to figure out, how to make a new image (let's say width 2390 pixels and height 1990 pixels - image1) and then resize an image (let's say width 1195 and height 1990) - image2) make 2 copies of it and then place them combined on the new created image (image1). I can't figure out how to do it. I hope somebody can help me with a tip.

Sorry for the bad english :wink:

Regards Onier
Onier
 
Posts: 1
Joined: Fri Jul 18, 2008 12:54 pm

Re: How to make composition

Postby Loïc on Tue Jul 22, 2008 11:42 am

Hi,

I give you a vb sample to open an image and draw it 2 time on a new empty image.

You can modify this code easily in order to draw other image at other positions:

Code: Select all
Dim nSrcImage As Long
Dim nImageCanvas As Long
Dim nCanvasHeight As Long, nCanvasWidth As Long

nCanvasHeight = 1990
nCanvasWidth = 2390

nSrcImage = Imaging1.CreateImageFromFile("input.jpg")
nImageCanvas = Imaging1.CreateNewImage(nCanvasWidth, nCanvasHeight, 32, White)

Imaging1.SetNativeImage (nImageCanvas)
Call Imaging1.DrawImage(nSrcImage, 0, 0, nCanvasWidth / 2, nCanvasHeight, InterpolationModeHighQualityBicubic)
Call Imaging1.DrawImage(nSrcImage, nCanvasWidth / 2, 0, nCanvasWidth / 2, nCanvasHeight)

Imaging1.SaveAsJPEG ("output.jpg")
Imaging1.CloseImage (nSrcImage)
Imaging1.CloseImage (nImageCanvas)


Best regards,

Loïc
User avatar
Loïc
Site Admin
 
Posts: 1195
Joined: Tue Oct 17, 2006 11:48 pm
Location: France


Return to Example requests & Code samples

Who is online

Users browsing this forum: No registered users and 0 guests

cron