Click here to Skip to main content
15,881,757 members
Articles / Web Development / ASP.NET

Save image with printed text on it

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
25 Sep 2012CPOL2 min read 11.7K   121   2  
Create an ASP.NET page where the user can edit/modify text for an image and then save that image with printed text on it.
��USE [master]

GO

/****** Object:  Database [TestImage]    Script Date: 09/25/2012 15:56:18 ******/

IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'TestImage')

BEGIN

CREATE DATABASE [TestImage] ON  PRIMARY 

( NAME = N'TestImage', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestImage.mdf' , SIZE = 2304KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )

 LOG ON 

( NAME = N'TestImage_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\TestImage_log.LDF' , SIZE = 504KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)

END

GO

ALTER DATABASE [TestImage] SET COMPATIBILITY_LEVEL = 100

GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))

begin

EXEC [TestImage].[dbo].[sp_fulltext_database] @action = 'enable'

end

GO

ALTER DATABASE [TestImage] SET ANSI_NULL_DEFAULT OFF

GO

ALTER DATABASE [TestImage] SET ANSI_NULLS OFF

GO

ALTER DATABASE [TestImage] SET ANSI_PADDING OFF

GO

ALTER DATABASE [TestImage] SET ANSI_WARNINGS OFF

GO

ALTER DATABASE [TestImage] SET ARITHABORT OFF

GO

ALTER DATABASE [TestImage] SET AUTO_CLOSE OFF

GO

ALTER DATABASE [TestImage] SET AUTO_CREATE_STATISTICS ON

GO

ALTER DATABASE [TestImage] SET AUTO_SHRINK OFF

GO

ALTER DATABASE [TestImage] SET AUTO_UPDATE_STATISTICS ON

GO

ALTER DATABASE [TestImage] SET CURSOR_CLOSE_ON_COMMIT OFF

GO

ALTER DATABASE [TestImage] SET CURSOR_DEFAULT  GLOBAL

GO

ALTER DATABASE [TestImage] SET CONCAT_NULL_YIELDS_NULL OFF

GO

ALTER DATABASE [TestImage] SET NUMERIC_ROUNDABORT OFF

GO

ALTER DATABASE [TestImage] SET QUOTED_IDENTIFIER OFF

GO

ALTER DATABASE [TestImage] SET RECURSIVE_TRIGGERS OFF

GO

ALTER DATABASE [TestImage] SET  ENABLE_BROKER

GO

ALTER DATABASE [TestImage] SET AUTO_UPDATE_STATISTICS_ASYNC OFF

GO

ALTER DATABASE [TestImage] SET DATE_CORRELATION_OPTIMIZATION OFF

GO

ALTER DATABASE [TestImage] SET TRUSTWORTHY OFF

GO

ALTER DATABASE [TestImage] SET ALLOW_SNAPSHOT_ISOLATION OFF

GO

ALTER DATABASE [TestImage] SET PARAMETERIZATION SIMPLE

GO

ALTER DATABASE [TestImage] SET READ_COMMITTED_SNAPSHOT OFF

GO

ALTER DATABASE [TestImage] SET HONOR_BROKER_PRIORITY OFF

GO

ALTER DATABASE [TestImage] SET  READ_WRITE

GO

ALTER DATABASE [TestImage] SET RECOVERY FULL

GO

ALTER DATABASE [TestImage] SET  MULTI_USER

GO

ALTER DATABASE [TestImage] SET PAGE_VERIFY CHECKSUM

GO

ALTER DATABASE [TestImage] SET DB_CHAINING OFF

GO

EXEC sys.sp_db_vardecimal_storage_format N'TestImage', N'ON'

GO

USE [TestImage]

GO

/****** Object:  Table [dbo].[Image]    Script Date: 09/25/2012 15:56:20 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Image]') AND type in (N'U'))

BEGIN

CREATE TABLE [dbo].[Image](

	[ID] [int] IDENTITY(1,1) NOT NULL,

	[ImageName] [nvarchar](50) NULL,

	[ImageTempName] [nvarchar](200) NULL,

	[ImageGUID] [uniqueidentifier] NULL,

	[ImageText] [nvarchar](50) NULL,

	[IsDeleted] [bit] NULL,

 CONSTRAINT [PK_Image] PRIMARY KEY CLUSTERED 

(

	[ID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

END

GO

/****** Object:  StoredProcedure [dbo].[spSaveImage]    Script Date: 09/25/2012 15:56:43 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spSaveImage]') AND type in (N'P', N'PC'))

BEGIN

EXEC dbo.sp_executesql @statement = N'-- =============================================

-- Author:		<Sonali Agarwal>

-- Create date: <18 July, 2012>

-- Description:	<This sp is used to insert/update data in Image table.>

-- =============================================

CREATE PROCEDURE [dbo].[spSaveImage]	

	@ID int OUTPUT,

	@ImageName nvarchar(50),

	@ImageTempName nvarchar(200),

	@ImageGUID uniqueidentifier,

	@ImageText nvarchar(50),

	@IsDeleted bit

AS

BEGIN

	If(@ID = 0)

	BEGIN

		insert into Image (ImageName, ImageTempName, ImageGUID, ImageText, IsDeleted)

		values

		(@ImageName, @ImageTempName, @ImageGUID, @ImageText, @IsDeleted)

	END

	else if(@ID <> 0)

	BEGIN

		Update Image set

		ImageName = @ImageName, 

		ImageTempName = @ImageTempName, ImageGUID = @ImageGUID, 

		ImageText = @ImageText, IsDeleted = @IsDeleted

		where ID = @ID

	END

END

' 

END

GO

/****** Object:  StoredProcedure [dbo].[spGetImage]    Script Date: 09/25/2012 15:56:43 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spGetImage]') AND type in (N'P', N'PC'))

BEGIN

EXEC dbo.sp_executesql @statement = N'-- =============================================

-- Author:		<Sonali Agarwal>

-- Create date: <18 July, 2012>

-- Description:	<This sp is used to retrieve records from Image table.>

-- =============================================

CREATE PROCEDURE [dbo].[spGetImage]

AS

BEGIN

	Select * from Image where IsDeleted = 0

END

' 

END

GO

/****** Object:  StoredProcedure [dbo].[spDeleteImage]    Script Date: 09/25/2012 15:56:43 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[spDeleteImage]') AND type in (N'P', N'PC'))

BEGIN

EXEC dbo.sp_executesql @statement = N'-- =============================================

-- Author:		<Sonali Agarwal>

-- Create date: <19 July,2012>

-- Description:	<This sp is used to delete record from table Image.>

-- =============================================

CREATE PROCEDURE [dbo].[spDeleteImage]	

	@ImageID int

AS

BEGIN

	update Image set IsDeleted = 1

	where ID = @ImageID

END

' 

END

GO

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Essential Solve LLC
India India
I am flexible, responsive, creative and enthusiastic with ability to manage multiple initiatives with deadline. I have willingness to pick up and develop new skills and ability to balance a number of conflicting priorities and make decisions. I am results oriented - focused on productive and high-yield activities.

Comments and Discussions