Showing posts with label save. Show all posts
Showing posts with label save. Show all posts

Saturday, March 31, 2012

TExt Box :-( image

Dear Advance,

How to save image from a given textbox text.

Regards,

Kamrul Hassan

huh?

You can't... if you want the client to upload an image use the upload control.... you can't pull a file off the client PC...thank heaven...

Monday, March 26, 2012

TEXT file as backup

Is it OK to save a backup copy of .CS or VB class file with .TXT extension to avoid errors at build? Thanks.

sure... I do it all the time. as long as you dont expect the app to USE it, your fine.

I save many of my .net files as txt, its handy.

Text in images

Hi, do anyone knows the best way to save text strings in an image space?
I've to print them with a laser plotter and I need them to be the sharpest
possible.
I'd prefer them to be vectorial but I don't know how (and if it is possible)
to do.
I tried to save the string @dotnet.itags.org.2400 dpi but when I open the images with such a
program like photoshop they are simply little and when I try to enlarge them
to fit the printing they lose definition and the image is non sharp.

This is a part of the code...

Dim pic As New System.Drawing.Bitmap(wi, he, PixelFormat.Format24bppRgb)
Dim g As Graphics = Graphics.FromImage(pic)
pic.SetResolution(150,150)
Dim solidBrush As New SolidBrush(Color.Black)
g.Clear(sfondogrigio)
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGri dFit
g.SmoothingMode = SmoothingMode.AntiAlias ' antialias objects

g.DrawString(something, font, color,x,y)

Thnks a lot.
AleAle,

It really depends on the original image size that you're loading. If you're
loading into a large image space the image must by in the proper resolution
to start with to fill this space.

You can resize of course but you will loose definition in that as you're
experiencing. The key is to make sure the oringal images you have or you
create dynamically are sized in the size that you need to start with. GDI+
is pixel based so it doesn't automatically resize and smooth out things
<g>...

+++ Rick --

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
-----------
Making waves on the Web

"Ale" <axxonkava123@.hotmail.com> wrote in message
news:c2cu7l$vn8$1@.nntp.atlavia.it...
> Hi, do anyone knows the best way to save text strings in an image space?
> I've to print them with a laser plotter and I need them to be the sharpest
> possible.
> I'd prefer them to be vectorial but I don't know how (and if it is
possible)
> to do.
> I tried to save the string @.2400 dpi but when I open the images with such
a
> program like photoshop they are simply little and when I try to enlarge
them
> to fit the printing they lose definition and the image is non sharp.
>
> This is a part of the code...
>
> Dim pic As New System.Drawing.Bitmap(wi, he, PixelFormat.Format24bppRgb)
> Dim g As Graphics = Graphics.FromImage(pic)
> pic.SetResolution(150,150)
> Dim solidBrush As New SolidBrush(Color.Black)
> g.Clear(sfondogrigio)
> g.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.ClearTypeGri dFit
> g.SmoothingMode = SmoothingMode.AntiAlias ' antialias objects
> g.DrawString(something, font, color,x,y)
>
> Thnks a lot.
> Ale
Does this page produce the sort of results you want?

http://www.lamartin.com/dotnet/TextToImage.aspx

"Ale" <axxonkava123@.hotmail.com> wrote in message
news:c2cu7l$vn8$1@.nntp.atlavia.it...
> Hi, do anyone knows the best way to save text strings in an image space?
> I've to print them with a laser plotter and I need them to be the sharpest
> possible.
> I'd prefer them to be vectorial but I don't know how (and if it is
possible)
> to do.
> I tried to save the string @.2400 dpi but when I open the images with such
a
> program like photoshop they are simply little and when I try to enlarge
them
> to fit the printing they lose definition and the image is non sharp.
>
> This is a part of the code...
>
> Dim pic As New System.Drawing.Bitmap(wi, he, PixelFormat.Format24bppRgb)
> Dim g As Graphics = Graphics.FromImage(pic)
> pic.SetResolution(150,150)
> Dim solidBrush As New SolidBrush(Color.Black)
> g.Clear(sfondogrigio)
> g.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.ClearTypeGri dFit
> g.SmoothingMode = SmoothingMode.AntiAlias ' antialias objects
> g.DrawString(something, font, color,x,y)
>
> Thnks a lot.
> Ale

Saturday, March 24, 2012

Text layout with SQL server

I want to be able to update some text directly on my site with a layout, and save it in SQL server. I don't see how to do that.

That means I also need a basic editor.

Actually the perfect example of what I am looking for is here when you post a message: basic editor, save and then display.

Thanks !

Hi,

and welcome to the ASP.NET forums.

The text editor that's used on these forums can be downloaded freely here:http://www.freetextbox.com/.

Grz, Kris.


Another popular RTE (rich text editor) isFCKeditor.

HTH,
Ryan

Thursday, March 22, 2012

text writing security worries

Hi,

I'm writing an application to load, edit and save xml with a flash7 front-end using .net scripts to write the xml.

Here's the script I'm using to save the xml:

private void Page_Load(object sender, System.EventArgs e){

String fileUrl;
String xmlData;
String returnToFlash;

fileUrl = Request.Form["fileUrl"];
xmlData = Request.Form["xmlData"];

StreamWriter sr = File.CreateText(Server.MapPath(fileUrl));
sr.WriteLine(xmlData);
sr.Close();

returnToFlash = "data=Success";
Response.Write(returnToFlash);

}

It's pretty simple, which is why I'm worried about the possibility of people 'spoofing' it with false data that hasn't come from my flash app.

There is a login script too which will (eventually) check the user credentials against a database to allow access. I was thinking that perhaps I should send these login credentials when saving a file to authenticate the user. Although I'm pretty sure there must be a better way to do it - ideally I don't want users to poll the database more than once per session.

This must be a problem that flash developers face all the time, I just haven't been able to find any articles on the topic (as I don't fully understand what I'm looking for!)

So my question is: What is the best way to secure access to this script without sending a username and password to check a database?

ThanksIt's a scary proposition when you are going to allow files to be uploaded to a web server. You should develop a strategy that allows you to upload files to a directory that only has Write permissions for the ASPNET/Network Service account as you want to prevent anyone from uploading an executable and being able to execute it.

That said, there is alot to security and this situation. I recommend you check out "Improving Web Application Security" and "Building Secure ASP.NET Applications".
I didn't consider the ASPNET/Network Service account permissions. They have already been set for me by hosting company for the directory I'm writing to. Perhaps this is enough?
Thanks for the links, I'll give them a read.

Tuesday, March 13, 2012

TextBox and Buttons

Hi!

I have a page with a textbox with a OnTextChange property, and two buttons (save and cancel).

In the OnTextChange method I would like to know which button was clicked (save or cancel), and suggestions how to check for that?

- LasseTake a look at a similarpost made couple of days ago
the method-OnTextChange for adding text into the textbox,how can i get the handle of the button,i cant understand your words(ps:sorry for saying this).
may be it can solve by the js