ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1735
Number of posts: 3305

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Watermark an Image with an Image Posted by Zantos on 17 Apr 2008 at 7:57 AM
Hey guys, I am a bit stuck and need your help.

I have the need to load images programmatically via script, and when the image is loaded, I need to watermark it __with another image__

Please do not send me links about adding text onto an image, i know how to do that already and that is not what I need.

I simply cannot find anything on how to take an image, and save another image on top of it... is it possible to use the Graphics class to open a 'canvas' and a second 'canvas' and overlay them on top of each other? I am at a loss :(

Any help you guys could provide would be greatly appreciated.

Thanks in advance,

John
<%
'// Programmed By: Zantos
'// VisualProgramming.NET
'// http://vp.funurl.com/
'// visualprogramming@gmail.com
%>
Report
Re: Watermark an Image with an Image Posted by Administrator on 18 Apr 2008 at 1:02 AM
Take a look at
http://www.codeproject.com/KB/GDI-plus/TransparentImageWatermark.aspx


/Administrator, ProgrammersHeaven

Report
Re: Watermark an Image with an Image (SOLUTION!) Posted by Zantos on 23 May 2008 at 11:25 AM
I was able to find out how to do this, and I shall share the code here with you guys! (Works only for JPEG/PNG as far as I can tell/tested)

Sub Page_Load
	
	'get original bitmap
	Dim original As System.Drawing.Image = New Bitmap(Server.MapPath("original.jpg"))
	Dim logo As New Bitmap(Server.MapPath("logo.png"))
		
	Dim gra As Graphics = Graphics.FromImage(original)
	gra.DrawImage(logo, New Point(0,70))
		
	'Set the content type
	Response.ContentType="image/jpeg"
		
	'send the thumbnail bitmap to the outputstream
	original.Save(Response.OutputStream, ImageFormat.jpeg)
		
	'tidy up
	logo.Dispose()
	original.Dispose()
	
End Sub

<%
'// Programmed By: Zantos
'// VisualProgramming.NET
'// http://vp.funurl.com/
'// visualprogramming@gmail.com
%>
Report
Re: Watermark an Image with an Image Posted by talerKK on 27 May 2013 at 7:29 PM
According to your description, I think you need load image from .NET graphics in C#.NET.AND you can follow the step below to Load Image from .NET Graphics.
Run Microsoft Visual Studio (2005 or later version);
Create a project with programming language - Visual C#;
Add RasterEdge.DotNetImaging.dll to your Visual C# applications;
Call RasterEdge .NET Image Namespace:


Report
Re: Watermark an Image with an Image Posted by talerKK on 27 May 2013 at 7:33 PM
According to your description, I think you need load image from .NET graphics in C#.NET.AND you can follow the steps below to Load Image from .NET Graphics.
Run Microsoft Visual Studio (2005 or later version);
Create a project with programming language - Visual C#;
Add RasterEdge.DotNetImaging.dll to your Visual C# applications;
Call RasterEdge .NET Image Namespace.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.