Page 1 of 1

Merging two images (ASP)

Posted: Tue Nov 25, 2003 7:46 pm
by Jimmeh
Hi,

I'm trying to use GFLAx to merge 2 gifs from within an ASP page. The problem I have is how to properly define the TYPE of AX_Image from ASP.

Is this possible? Or will I need to write a wrapper COM object to handle it?

Thanks

Re: Merging from ASP

Posted: Tue Nov 25, 2003 8:53 pm
by xnview
Hi,
Jimmeh wrote:I'm trying to use GFLAx to merge 2 gifs from within an ASP page. The problem I have is how to properly define the TYPE of AX_Image from ASP.Is this possible? Or will I need to write a wrapper COM object to handle it?
A new version of GFLAX will be available the next week, with merging feature.
Regards. Pierre.

Where? Where Merge for ASP?

Posted: Wed Dec 03, 2003 5:54 am
by Andrew P
I'm very .. I'm very want Merge method for ASP.... :wink:
Maybe some simple function which Merge current image with only one other image?.... something as .Merge( filename, opacity, x, y) ... without any arrays & structures.... ????

when the merge option is avaiable?

Posted: Sun Jun 27, 2004 4:38 pm
by Miku
Hi,
thanks a lot for your job, If u need anything call me! I ask you only the merge method. Is it avaiable? :?:

Please make me a little example. Thanks :D

Miku

Re: when the merge option is avaiable?

Posted: Mon Jul 12, 2004 12:25 pm
by xnview
Miku wrote:Please make me a little example.

Code: Select all

	.MergeAddFile Path & "\img0.tif", 40, 0, 0
	.MergeAddFile Path & "\img1.tif", 15, 0, 0
	.MergeAddFile Path & "\img2.tif", 15, 0, 0
	.MergeAddFile Path & "\img3.tif", 20, 0, 0
	.Merge
Pierre.

Merging example

Posted: Tue Jul 19, 2005 1:54 pm
by Andy
Hello!

I've tried your code (after studying the help file) and it always returns "an empty object". I mean, if I try with applying date.gif to existing picture:

Code: Select all

Set sir = Server.CreateObject("GflAx.GflAx")
sir.EnableLZW = true
with sir
  .MergeAddFile Server.MapPath("pic1.gif"),40,0,0
  .MergeAddFile Server.MapPath("pic2.gif"),15,0,0
  .Merge
end with
' any object Method
sir.Crop 100,100,200,200 '<- this line
there comes to error with sir being "empty": GflAx.GflAx.1 error '80004005'
No file opened

Do I have to load an initial image? How to get and use the merged image?

Thank you,

Andy

Re: Merging example

Posted: Tue Jul 19, 2005 2:01 pm
by xnview
Andy wrote:Hello!

I've tried your code (after studying the help file) and it always returns "an empty object". I mean, if I try with applying date.gif to existing picture:

Code: Select all

Set sir = Server.CreateObject("GflAx.GflAx")
sir.EnableLZW = true
with sir
  .MergeAddFile Server.MapPath("pic1.gif"),40,0,0
  .MergeAddFile Server.MapPath("pic2.gif"),15,0,0
  .Merge
end with
' any object Method
sir.Crop 100,100,200,200 '<- this line
there comes to error with sir being "empty": GflAx.GflAx.1 error '80004005'
No file opened

Do I have to load an initial image? How to get and use the merged image?

Thank you,

Andy
Yes load a picture, or create a new one before merging

Posted: Wed Sep 21, 2005 9:40 am
by mindplay
does this work with RGBA formats? e.g. TIFF or PNG with alpha-channel?

I want to use it for watermarking, but it doesn't seem to work.

I modified the "merge.asp" example as follows:

Code: Select all

<HTML>
<HEAD></HEAD>
<BODY>
<%

const AX_JPEG = 1

Dim Path, File

Set ctrl = server.createobject("GflAx.GflAx")
Path = Server.MapPath(".") 
File = Path & "\image.jpg"

With ctrl
	.EnableLZW = TRUE
	.MergeAddFile Path & "\img0.tif", 40, 0, 0
	.MergeAddFile Path & "\img1.tif", 15, 0, 0
	.MergeAddFile Path & "\img2.tif", 15, 0, 0
	.MergeAddFile Path & "\img3.tif", 20, 0, 0
	'.MergeAddFile Path & "\logo.png", 20, 0, 0
	.Merge

   .SaveFormat = AX_JPEG
   .SaveJPEGQuality = 70
   .SaveBitmap Path & "\result.jpg"
   
end with

set ctrl=nothing
%>
<IMG SRC="result.jpg">
</BODY>
</HTML>
But when I uncomment the merge command for "logo.png", the SaveBitmap command returns error '80004005' ("no file opened").

I've also tried with a TIFF instead, but same result.

Do I have to save in PNG or TIFF format, and if so, specifically what settings should I use when saving out of Photoshop?

Is merging with alpha-channel supported in the first place?

You can get my "logo.png" and "logo.tif" I use for testing here:
http://www.danline.dk/test/logo.zip

...

By the way, AX_JPEG was set to 3 in the provided example - which is wrong, according to the documentation the code for JPEG should be 1.

Posted: Fri Sep 23, 2005 2:36 pm
by xnview
mindplay wrote:does this work with RGBA formats? e.g. TIFF or PNG with alpha-channel?
Ok, so don't use Merge, but DrawImage

Posted: Tue Sep 27, 2005 9:24 am
by mindplay
that works, awesome! thanks! :)

Posted: Tue Sep 27, 2005 9:29 am
by mindplay
oh, and here's the corrected code for placing the "logo.png" in the lower-right corner, on top of the image.

Code: Select all

With ctrl
	.EnableLZW = TRUE
	
	.LoadBitmap Path & "\logo.png"
	LogoW = .Width
	LogoH = .Height
	
	.LoadBitmap File
	.DrawImage Path & "\logo.png", .Width-LogoW, .Height-LogoH

   .SaveFormat = AX_JPEG
   .SaveJPEGQuality = 70
   .SaveBitmap Path & "\result.jpg"
   
end with