473,832 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding an logo-image/tekst to an existing image.

On my webpage I am making I want that if users view any image in my gallery
a small logo/tekst will appear in the image.
I know it's possible but I haven't got a clue how to get a logo or tekst on
a image.

Does someone got an example or somewhere I can read more about it except the
MSDN?

thx in advance.

Richard
Nov 18 '05 #1
6 1959
On Tue, 15 Jun 2004 20:20:10 +0200, "Richard" <ri*****@nospam .com>
wrote:
On my webpage I am making I want that if users view any image in my gallery
a small logo/tekst will appear in the image.
I know it's possible but I haven't got a clue how to get a logo or tekst on
a image.

Does someone got an example or somewhere I can read more about it except the
MSDN?

thx in advance.

Richard


you can use System.Drawing. Image. you will have to read about this
class as well as the Bitmap class in order to be able to combine an
image with another.

-Adam
Nov 18 '05 #2
Hi Richard,

As for how to manipulating image in asp.net web application and add some
mark/logo in it so as to protect them from linked by other user or sites.
Here are my suggestions:

First of all, Adam's suggestion that use the GDI+ api under the
System.Drawing. Image namespace is quite reasonable and it has provided
sufficient interfaces for manipulating image. And as for add our custom
flag/mark in the image in our web app when they're requested by other
users, gerenally we need to do the following steps:

1. Define a HttpHandler to service all the image request and use GDI+ code
to manipulate the image and output it to user.

2. After built the HttpHandler , register it in web.config of the asp.net
web application. And don't forget to set the ISAPI extension in IIS's
virtual dir ,we have to mapp the image extension(we want to processed by
our handler) to the aspnet_isapi.dl l.

In addition, here are some tech articles discussing manipulating image in
asp.net

#Watermark Website Images At Runtime
http://www.codeproject.com/aspnet/httpImageHandler.asp

#HTTP Handlers for Images in ASP.NET
http://www.c-sharpcorner.com/Code/20...sForImages.asp

#Image Generation Service for ASP.NET 1.1
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Hope also helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
As Steven said.
Here is a piece of code I used to implement such a http handler. The
handler is adding some text to the image. You should remove the security
check...

public class AddJpegCopyrigh tHttpHandler : IHttpHandler
{
const string COPYRIGHT_NOTIC E = " a copyright notice";
private SolidBrush brush = new SolidBrush(Colo r.Gray);

public AddJpegCopyrigh tHttpHandler()
{
}

#region Implementation of IHttpHandler
public void ProcessRequest( System.Web.Http Context context)
{
string filePath = context.Request .MapPath(contex t.Request.FileP ath);

PhotoGaleryPrin cipal user = System.Web.Http Context.Current .User as
PhotoGaleryPrin cipal;
bool isPrivate = filePath.IndexO f("\\PrivateGal ery\\") != -1;
if( (user == null && isPrivate) || (user != null &&
!user.AlowPriva teAccess && isPrivate) )
{
throw new System.Security .SecurityExcept ion("The picture you
requested is in a private galery. You must be logged in and have access
to private galeries to access this picture.");
}

Bitmap photo = (Bitmap)Bitmap. FromFile(filePa th);
if( photo.Width > 200 && photo.Height > 200 )
{
Graphics g = Graphics.FromIm age(photo);
Font font = new Font("verdana", photo.Height / 100);
SizeF size = g.MeasureString (COPYRIGHT_NOTI CE, font);
g.DrawString(CO PYRIGHT_NOTICE, font, brush, photo.Width -
size.Width - 10, photo.Height - size.Height * 1.2F);
g.Dispose();
}
context.Respons e.ContentType = "image/jpeg";
photo.Save(cont ext.Response.Ou tputStream, ImageFormat.Jpe g);
}

public bool IsReusable
{
get
{
return true;
}
}
#endregion
}

hope this helps
_______________ _____
www.bloomfield.as.ro
Nov 18 '05 #4
Hi Richard,

Have you had a chance to check out the suggestions in the former replies or
have you got any further ideas on this issue? If there're anything else we
can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5
the HTTPHandler stuff is still a bit out of my league. atm I am reading more
about it and
from all I have seen I like what you can do with it so its a much know for
me.

I still have some issue's with putting another logo on an existing image but
the text works for me now.
I guess I just have to read some more and play a bit with it.

Anyway, thx for the help,

Richard

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> schreef in bericht
news:QH******** ******@cpmsftng xa10.phx.gbl...
Hi Richard,

Have you had a chance to check out the suggestions in the former replies or have you got any further ideas on this issue? If there're anything else we
can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
Hello Richard,

Steven is OOF these two days. :) However, if there is any more question on it, please feel free to post in the group. We will follow up with you.

Thanks very much for participating the community.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3478
by: Xah Lee | last post by:
it would be good if Bash and Python have a decent logo. the current logos of simplistic font http://cnswww.cns.cwru.edu/~chet/img/bash-org.jpg http://python.org/pics/pythonHi.gif are homely. -- some quick tips for good logos:
15
3339
by: Albretch | last post by:
I am trying to design a "multilingual" logo. I was thinking about having a background graphic with two letters (the company name's accronym) on top of it. The thing is that (of course) the accronym changes for each particular language. John Yunker in his excellent book on web globalization: "Beyond Borders", rightly critisizes the use of accronims like "IBM" in a global market, he gave plenty of reasons and related etc.'s.
5
2121
by: Andrew Thompson | last post by:
I have a (rather challenged) css design for my site logo at http://www.lensescapes.com/tst/photologo.jsp It shows not only the current rendering of the design, but also has links to the CSS behind it, and shows a GIF of how I'd like it to look. In the most recent Windows - IE6 and Mozilla 1.3a show that the 'lens' and 'escapes' parts do not fill the boxes they are in, which makes it look rather
3
2012
by: Uffe Kousgaard | last post by:
I have been looking for a logo for the .NET framework similar to the Linux (the penguin) and java (cup of coffee) logo's. Not something like "I support .NET" or ".NET certified". Just a neutral logo for the framework. TIA Uffe
4
2636
by: Xah Lee | last post by:
A Lambda Logo Tour (and why LISP languages using λ as logo should not be looked upon kindly) Xah Lee, 2002-02 Dear lispers, The lambda character λ, always struck a awe in me, as with other mathematical symbols. In my mind, i imagine that those obscure math
2
1246
by: hazz | last post by:
Below is one row with a company logo in the left table cell and 'Reporting Tool' in the table cell on the right. I would like to add a button in this same row, just to the right of the company logo, which will be for clicking on to create an Excel spreadsheet from the grid. How do I use the colspan tag so that the rows above and below don't create new table cells themselves? Thank you. -greg <tr> <td colspan="1" style="height: 1px;...
1
2336
by: ds26347 | last post by:
Hi everyone, I have been searching the web for about two hours trying to figure out how to add a load screen to media player. In my site I have the media player set to play when clicked which produces a blank screen. I would like to add a logo so when it is not activated there is something there other than a white box. Any help is appreciated. Thanks Dan website:http://www.warrior-scholar.com/moodle15/
11
1569
by: Xah Lee | last post by:
recently on #emacs irc of freenode, there's a discussion of a logo of planet emacsen site. I made some comments about such logo: http://paste.lisp.org/display/28901 I have brought this topic here here before... that i think LISP really need to have a logo. I'm aware of “made with alien technology lisp” web-badge, but that is a lisp-peddling badge, not a lisp logo proper.
1
1810
by: colmkav | last post by:
Hi, when I try to add a logo to my form I click on the unbounded object frame and then browse for tje location of my logo. I open the .bmp file but get an error claiming "OLE object isnt registered". I get same type of error for other items I try to upload. could someone pls tell me how I can resolve this problem?.
1
3156
by: timsamshuijzen | last post by:
The website I am developing is implemented as a Single Page Interface (SPI). During a visitor's session all new content gets loaded by JavaScript (Ajax), no new pages get loaded and the URL in the address bar does not change. This has many advantages for the website application I am building (I will not go into the details of the advantages here), but the obvious down-side is that the visitor will get unexpected results when pressing the...
0
9795
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10781
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10499
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10541
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.