|
The strange thing is that it's not doing it to every image. Some look great and some look blurry and it's all using the same code. Is there something I need to do to repair images in SQL Server...
|
|
|
|
|
What format are your images in? What are you downloading them as?
More importantly, blurry images normally mean that the size does not match the original size. So, a 320x280 image will appear blurry if viewed at 300x270.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm using that code almost verbatim. Every image is a jpeg and I batch sized all of them down for huge 3+ meg images to 200Kb on average images using "Easy Thumbnails" which will do more than just thumbnails. It's a nice product to just give away.
Oddly all of the images from Easy Thumbnail look great on disk and some of them look bad out of the DB. Here's my actual code (the output parameter is the URL parameter of the Image):
if (Request.QueryString["ImgID"] != null && Request.QueryString["Orientation"] != null)
{
System.Int32 _ImgID = Convert.ToInt32(Request.QueryString["ImgID"].ToString().Trim());
string _Orientation = Request.QueryString["Orientation"].ToString().Trim();
HttpContext.Current.Session["PrevID"] = _ImgID;
SqlDataReader thisReader = null;
SqlConnection thisConn = new SqlConnection(ConfigurationManager.ConnectionStrings["MediaGalleryConnectionString"].ConnectionString);
SqlCommand thisCmd = new SqlCommand("Command String", thisConn);
tmpStr = "Select PageImage, PageText from PhotoGallery WHERE RecordID='" + _ImgID.ToString() + "'";
thisCmd.CommandText = tmpStr;
try
{
thisConn.Open();
thisReader = thisCmd.ExecuteReader(CommandBehavior.CloseConnection);
while (thisReader.Read())
{
System.Drawing.Image _image = System.Drawing.Image.FromStream(new System.IO.MemoryStream((byte[])thisReader["PageImage"]));
System.Web.HttpContext.Current.Response.ContentType = "image/jpeg";
if (Request.QueryString["Orientation"].ToString().Trim() == "Landscape")
{
System.Drawing.Image _newimage = _image;
_newimage.Save(System.Web.HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
else if (Request.QueryString["Orientation"].ToString().Trim() == "Portrait")
{
System.Drawing.Image _newimage = _image;
_newimage.Save(System.Web.HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
}
catch{}
finally{}
}
|
|
|
|
|
Got it. Corrupted images in the database. I delete the entire record. Recreate it with a new PK/Index and it's all good. Strange.
- Rex
|
|
|
|
|
Hi All,
I am using DataGrid Control to ASP.NET,C# Web Application.
I have added template column for Data Grid and added Image button for ItemTemplate.
Now I need to fire Click event when Image button Pressed on a Perticular Data Row .
There are 20 or More rows in a DataGrid.
Can any one tell me how to bind ClickEvent for ImageButtons on a Template Column?
Thanks in advance.
|
|
|
|
|
Hi,
You can use oncommand for the imagebutton. Add an image button to your template like so.
<<asp:imagebutton commandargument="ValueYouPassIN" commandname="ImageClick" oncommand="ImageClick_Command" id="ImageButton1" runat="server">
Then just create a method that does what you want.
<br />
protected void ImageClick_Command(object sender, CommandEventArgs e) <br />
{<br />
Response.Write("test");<br />
<br />
} <br />
<br />
Regards
tom
|
|
|
|
|
hi there,
when redirect to another page using response.Redirect() ,it generates
an http get operation , i want to change the headers for that (get) to add cookie , i tried to use respnse.AddHeader(), request.Headers.Add() but didn't work ,it is urgent thanks
|
|
|
|
|
I'm sure this has been posted a million times before, but how do i force my footer stay at the bottom of my browser, even if the content is too small to push it down.
Posted by The ANZAC
|
|
|
|
|
Try this article on alistapart:
http://www.alistapart.com/articles/footers/[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Guys i need a help,
i'am creating a report application using ASP.NET & Crystal Report in VS2003,
i'am retrieving a lot of data from Oracle DB, it's about more than 75000 records.
if the amount of record less than 1500 it works fine and fast,
my problem is if the record number greater than that = the process is taking to long and it will stop because the session is timeout.
can somebody in here tell me how to generate report faster?
thanx
|
|
|
|
|
fajrif wrote: i'am retrieving a lot of data from Oracle DB, it's about more than 75000 records.
if the amount of record less than 1500 it works fine and fast,
my problem is if the record number greater than that = the process is taking to long and it will stop because the session is timeout.
Do you individually display all 75000 rows in the report, or are they aggregated in some way? If they are aggregated then it may be a good idea to produce a set of tables with the precalculated aggregates that can be used for the report. This is a common technique used to help generate a standard set of reports quickly. The drawback is that the data used for the report is not updated as frequently as the data in the source tables. Typically the reporting tables will be updated by an overnight batch, or at the weekend or month end depending on the type of report that is needed.
|
|
|
|
|
We are doing the same exercise. Table is having millions of records. Then we are storing agg values in tables i.e. Fact table. And life is simple. And make sure you use stored procedure and with good index technq. It really works and helps. I am eye witness for the same.
Amit
|
|
|
|
|
This many records are going to take a long time to produce in Crystal Reports, pretty much no matter what you do. Remember that the problem is not just the extraction of the records, it is also the rendering them for output (and that's a lot of data to play with). In situations like this, I would see if it is possible to pre-render the reports ready to be displayed.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I want to show my error page in new page. Old page should still shows old data.
I write in applicationerror event in global, this:
response.write("window.open('errorpage.aspx')");
But there is a problem with it. The old page shows aspx error message displaying my code and exception. If I set custom error in config, my old page will be redirected to errorpage which is set in custom error tag.
If I use Server.ClearError() method, the old page will be cleared entirely and shows blank page.
I WANT MY OLD PAGE TO SHOW THE OLD DATA WITH USER CHANGES WHICH CAUSING ERROR AND THE NEW PAGE, SHOWS MY ERRORPAGE LIKE ERROR MESSAGE IN WINDOWS APPLICATION.
I don't want to handle my all errors by try catch. I want to handle all of them in allication error. Because I can find my latest exception by Server.GetLastError() method.
Please instruct me what to do.
Thanks
Rastgar
|
|
|
|
|
See the section on Application_Error in http://support.microsoft.com/kb/306355[^].
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Anyone know how to get / set the position of the scrollbars on a panel web server control.
Thus I can remember where a user was in a given panel, if they had used the scroll bars???
Many thanks
|
|
|
|
|
yourpanleid.scrollTop, yourpanelid.scrollLeft.
for your panel id, refer your page html which is rendered.
note, these two methods are client side methods.
you can save them in a hidden field. i save them in a hidden textbox by scrollchange() method. and set them by changescroll() method:
function scrollchange()
{
document.getElementById("txtScroll").value=document.body.scrollTop;
document.getElementById("txtScroll").value+=";"+document.body.scrollLeft;
}
function changescroll()
{
if(document.getElementById("txtScroll").value != "")
{
parts = document.getElementById("txtScroll").value.split(";");
document.body.scrollTop = parseInt(parts[0]);
document.body.scrollLeft = parseInt(parts[1]);
}
}
Thanks
Rastgar
|
|
|
|
|
Hi Rastgar
Many thanks for the pointer - FYI my implementation of the initialisation, is like this: (c#)
StringBuilder sb = new StringBuilder();
sb.Append("");
sb.Append("var szValue = document.getElementById('Panel1');");
sb.Append("szValue.scrollTop = 146;");
sb.Append("szValue.scrollLeft = 182;");
sb.Append("");
ClientScript.RegisterStartupScript(typeof(string), "Init", sb.ToString());
This then just runs at startup.
And of course I can harvest the values from the user by any number of means
Once again, many thanks
regards, John
|
|
|
|
|
So I'm using this code to make a table background gradient and it works great but only in Internet Exploder:
filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#DDDDDD', startColorstr='#FFFFFF', gradientType='0');
Is there a javascript way to do this that will be browser independent? Also I know I can do this with an image but my skill isn't up to par with sizing that image correctly so that it will handle this table properly. This table contains dynamic news events and it's height will change by the day in most cases and I just don't know how to make the background image adjust it's size to the table on each page load.
- Rex
|
|
|
|
|
|
This is where I establish my own lack of skill in this stuff.
How would I apply that to a table? I don't even know and cannot begin to fathom from the scripts posted there.
|
|
|
|
|
You are a C++ expert, and that alone qualifies you as a genius! web development is a piece of cake once you get a hang of that stupid html and js
Take it one step at a time; within the desired <td> , insert a table with one column and as many rows as you need (or vise versa), set the table's width to 100%. Make sure the container <td> (or its corresponding table) has 0 cellspace and 0 cellpadding to create a smoother effect.
Now, think about how you want to display the smooth gradient... think hex digits! The RGB is directly translated to the # sign followed by R then G then B from decimal to hex (e.g. RGB = 0, 51, 153 translates to HEX = #003399 for a dark blue) creating one hex value to identify a qnique colour. Now that you know how this works, think how you were to build series (array) of strings that 1) represent hex color codes, and 2) are in correct order for an extra smooth effect!
Build your array in a for loop, adding incremented RGB values translated to hex, then pushed into a specific position within your array.
So far you have your inner table, and your array of hex colours ready to go, all you have to do is to throw your table into yet another for loop and assign the value of each element in your array as the corresponding <td> 's color attribute (e.g. td1.style.backgroundColor = a[i]).
This is a small and quick step to becoming more familiar with dhtml. Once you get a hang of it, see what else you can do with that sucker
Nila
|
|
|
|
|
C++ was back in 1999 haven't really used it much since then. Those were the days but it was *all* WIN32.
|
|
|
|
|
ahh blah! C++ will always be the king of nerdy programming even if it was *done* in 1999 I did some of that back in 2001, in fact that was the first programming language I learned to write (oops, now you know Im just a kido!! )
Nila
|
|
|
|
|
Grapes-R-Fun wrote: Build your array in a for loop, adding incremented RGB values translated to hex, then pushed into a specific position within your array.
Right. So insert the colors into a string array with FFFFFF at the top (or read first) the transitions from FFFFFF to DDDDDD at the end or read last.
No problem there.
Grapes-R-Fun wrote: So far you have your inner table, and your array of hex colours ready to go, all you have to do is to throw your table into yet another for loop and assign the value of each element in your array as the corresponding <td>'s color attribute (e.g. td1.style.backgroundColor = a[i]).
Here's where it's tricky. What you describe if I'm following you is that each transition will take one index of the array which would most likely be 5 td's or transitions total on average.
This means that it's not going to be all that smooth. There will be 5 transitions:
Index[0]#FFFFFF <td></td>
Index[1]#F7F7F7 <td></td>
Index[2]#EEEEEE <td></td>
Index[3]#E6E6E6 <td></td>
Index[4]#DDDDDD <td></td>
With this approach I'm going to need about 15 <td>'s for each table in order to have a smooth transition.
Either I'm not following you well or this approach isn't going to be feasible due to the low number of <td>'s present in each <table>.
Right?
|
|
|
|