Click here to Skip to main content
15,610,088 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hey experts please help me convert this C# code to matlab. the code is as below.

<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="ASPJPEGLib" %>
<%@ Page aspCompat="True" Language="C#" Debug="true" %>
<script runat="server" LANGUAGE="C#">
void Page_Load(Object Source, EventArgs E)
ASPJPEGLib.IASPJpeg objJpeg;
objJpeg = new ASPJPEGLib.ASPJpeg();
objJpeg.Open( Server.MapPath("clock.jpg") );
objJpeg.Width = (int)(objJpeg.OriginalWidth * 0.8);
objJpeg.Height = (int)(objJpeg.OriginalHeight * 0.8);
if( Request["Grayscale"] == "1" )
objJpeg.Grayscale( 1 );
if( Request["Sharpen"] == "1" )
objJpeg.Sharpen( 1, 250 );
if( Request["Horflip"] == "1" )
if( Request["Verflip"] == "1" )
objJpeg.Quality = int.Parse(Request["Quality"]);
objJpeg.Interpolation = int.Parse(Request["Interpolation"]);
if( Request["Crop"] == "1" )
objJpeg.Crop( 30, 30, 470, 320 );
Updated 29-Aug-22 18:54pm

1 solution

This is an ASP.NET page, and it's using some sort of external library ( to do things you could easily do in C# natively ). It's possible to guess what this external component does, but, given that matlab is a library for graphics work, one would also assume that matlab is well able to apply a sharpen filter, or flip an image. I've only ever heard of students using matlab, I would suggest that where-ever you got this code snippet, it's not doing anything groundbreaking, what it does is obvious, and you should refer to your textbooks or your teacher to work out how to do the things you want to do with matlab.
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900