|
I need to resize and want to save in disc so pixel quality will be maintained.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Then explore the 3rd option, you will find some example in the article which scales the image by fixed size of percentage.
Regards,
Prakash Kalakoti
|
|
|
|
|
It's resizing image but no quality in image like in 800*600 dimension.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
This Function Can help you!
Public Function ResizePicture(ByVal sourceImage As Bitmap, ByVal newSize As Size) As Bitmap
Dim Result_image As New Bitmap(sourceImage, newSize.Width, newSize.Height)
Dim Gr As Graphics
Gr = Graphics.FromImage(Result_image)
Gr.DrawImage(Result_image, 0, 0, newSize.Width, newSize.Height)
Gr.Save()
Return Result_image
End Function
Then you can save the output of this Function By using ResizePicture(MyBitmap, New Size(100, 100)).Save(MapPath("/") & "/Images/MyImage.png", Imaging.ImageFormat.Png)
Note: These codes are in VB.NET Language, but you can simply convert it to C# or any .NET language
Regards.
Mehdi Ghiasi
|
|
|
|
|
just 2 questions:
1) is there such a thing as a default httphandler? for example, the handler that is invoked when the extension of a requested resource is not assigned to a handler within the .config file?
2) a related question is a handler that is invoked for any resourcetype requested?
grache'
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
Yes there is. DefaultHttpHandler renders every request when no custom HttpHandler is configured.
See
http://msdn.microsoft.com/en-us/library/system.web.defaulthttphandler.aspx
Yes for every request to a resource too there is an httphandler. WebResource.axd is configured in Web.Config which requests resource embedded in your dll.
|
|
|
|
|
Hi friends,
I am a student and new to active directories.
I have installed windows server 2003 on my machine and even visual studio 2005 on it.
I am trying to login using active directories and it says "<b>Unable to establish secure connection with the server</b>" .
<b>My full computer name: sdmcet.sdmcet.cse
Domain: sdmcet.cse.</b>
I have included my web.config file below. Can anyone please let me know where i have gone wrong or whether i need to make any changes on windows server 2003 settings.
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings>
<add name="ADConnectionString" connectionString="<b>LDAP://sdmcet.sdmcet.cse/CN=Project_Users,DC=sdmcet,DC=sdmcet,DC=cse</b>"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms name=".ADAuthCookie" timeout="10"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add
name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername=<b>"sdmcet\administrator"
connectionPassword="password"</b>/>
</providers>
</membership>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
The text in bold faces is what i have changed.
Pls help ..
|
|
|
|
|
“Unable to establish secure connection with the server” seems to be due to Authorization failure.
You are using forms authentication, and account on which the application is running is not having access to the Active Directory. Try doing one of the two things.
1- Change the authentication mode to Windows and set the < Identity Impersonate="true" > in the configuration file.
2- If its not possible to change the authentication mode then try to impersonate a AD user dynamically before establishing the connection to ADSI and undo the impersonation once you are done.
Regards,
Prakash Kalakoti
modified on Thursday, March 25, 2010 12:14 AM
|
|
|
|
|
Are there any other information that you can gather, other than the "Unable to establish secure connection with the server."? Can you check at runtime if you code is actually connecting to sdmcet.sdmcet.cse and negotiating with authentication? This error can be due to the fact that sdmcet.sdmcet.cse cannot be found. You may opt to use IP address instead of sdmcet.sdmcet.cse. Also, "secure" connection usually means your URI should include S (LDAPS://) instead of plain LDAP://.
Remember, your work is not yours alone. Somewhere, there are some codes written by others amongst us that depends on your work. By failing to see that you are part of their ecosystem, you are bound to break their code. *http://dotnetrandz.blogspot.com*
|
|
|
|
|
I have a table row tag with three td blocks, and below a tr with two td blocks.
On the second tr, I want the td blocks to run all the way across the screen, but it stops level with the end of the end of the second td block in the preceeding tr.
?
Am I being dim?
------------------------------------
<b>I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel.</b> Dalek Dave
|
|
|
|
|
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td colspan="2"></td>
</tr>
</table>
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote:
That's it!
I just couldn't remember, as I say it was very late at the time.
Cheers.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
what is the newer version for this?
It is compiling but bitching in the Error List.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
CssClass. If you aren't using CSS then shame on you!
|
|
|
|
|
Shame on me.
I will remedy it with gusto and aplomb!
Thanks.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Hy,
i have to open a page and remove its tool bar at runtime.is there any way i can do it while using response.redirect as i cannot ue window.open
|
|
|
|
|
You can always set the visibility of a control, either from the code-behind or via javascript. Response.Redirect has nothing to do with it.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thnks for the reply...but can u tell me how to make the tool bar visbilty false in code behind
|
|
|
|
|
No
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
you need to use JavaScript and it will only work for a popup window. - else you cant do it "Security Issues".
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
It is not possible to programmatically hide the menubar or toolbar on a window that is already open. I found similar JS from the net but it is for Netscape:
function showmenu()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
window.menubar.visible=true;
window.directories.visible=true;
window.statusbar.visible=true;
...
and I do not know if it works. (who's using Netscape anyway? Official support for Netscape ended on March 1st, 2008.)
Remember, your work is not yours alone. Somewhere, there are some codes written by others amongst us that depends on your work. By failing to see that you are part of their ecosystem, you are bound to break their code. *http://dotnetrandz.blogspot.com*
modified on Friday, March 26, 2010 4:00 AM
|
|
|
|
|
I am using the asp.net mvc framework and like it so far, however there are times that I need to use a code behind page. mainly for my gridview events and such. MVC does not use or recommend using code behind pages. So my question is, how would I put the events for my gridview, or any code that is in my code behine, in my usercontrol and aspx pages?
Would it be as simple as this:
UserControl sample:
<br />
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ai_dcs_isets.Models.dcs_users>" ><br><br />
<%@ Register Src="PopUpBox.ascx" TagName="PopUpBox" TagPrefix="uc1" ><Br><br />
<uc1:PopUpBox ID="PopUpBox" runat="server" ShowCloseButton="true" /><br><br />
<br />
<script language="C#" runat="server"><br><br />
void page_load(Object sender, EventArgs args)<br><br />
{<br />
<br />
<br />
}<br />
<br />
</script><br />
if so, what is going to keep these events in order if my user control is apart of a page that has it's own page_load or other events? Would my gridview events be a mere copy and paste from code behind to the script area?
Sorry if this is a basic question, web development has never really been my main development.
Thanks for the help.
|
|
|
|
|
MVC does not include code-behind for a good reason; asking to use it violates the concepts and principles of the pattern.
What events are you trying to use?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I agree, which is why I need to put what code I was going to use in code behind, in my usercontrol and aspx pages.
The code right now that I need to use:
<br />
void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
void GridView1_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)<br />
{<br />
<br />
}<br />
<br />
And possibly RowCreated event.<br />
Right now it is just this. Some of my code I could move to the Controller and also most can be handled in the Model itself, but events like this I am not sure what to do with.
Thanks for the time.
|
|
|
|
|
There is essential no need to handle these events with code-behind, or code-in front
RowCreated is already being done as the view is being rendered
The other events can be handled with JavaScript or by the controller. SelectedIndexChanged I can see being handled with JavaScript.
I know the language. I've read a book. - _Madmatt
|
|
|
|