16,004,836 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Silver13 (Top 26 by date)
Silver13
13-Oct-15 18:50pm
View
I red on one of the articles that Dynamic is one of the underused feature of the code. That's what got me thinking about it.
Also, right here on Code Project i came across this.
http://www.codeproject.com/Tips/460614/Difference-between-var-and-dynamic-in-Csharp
Very informative answer to my question. Thanks Bill. I am definitely going to look at the free book you suggested.
Silver13
13-Oct-15 18:36pm
View
Thanks for the links, i have red them already. I do understand a bit about it but i cannot say that i truly understand it yet.
Just as you said it: "tell us the difference between apple and Apple"
I came to the same conclusion that they appear same but are not quite.. hence why i wanted someone with more experience help me understand it better.
Why do we have two things that are capable of seeming same things. Thanks for the second link though, i missed that one.
Silver13
16-Sep-15 19:34pm
View
Pretty straight forward. I always underestimate the power of Regex. This is a great solution!
Silver13
16-Sep-15 19:33pm
View
The numbers are always going to be inside val{} for this scenario.
The target is to get those numbers inside. The only other constrain for this would to ignore zeros.
Silver13
27-Jul-15 22:16pm
View
Also, very important to have is return statement for everytime e.HasMorePages is set to true, otherwise code wont realize it needs to start new page.
Thanks for the help.
Silver13
23-Jul-15 20:04pm
View
I understand the how this should go down, and i have followed your document as well as numerous suggestions on how to fire e.HasMorePages event, but i think my problem here is coming from the "foreach (DataRow row in tmp_Table.Rows)"
I have set the limit to be 20 rows and once reached e.HasMorePages is set to true. That should basically print next page with the another 20 rows out of 60 until end. In my scenario it should print 3 pages, but that is not happening. It just duplicates the first 20 rows. I am not sure how else to handle this and why the e.HasMorePages is not going to next page.
Silver13
7-Jul-15 20:26pm
View
This is a very unclear question you have here.. Do you have any code to show what you have done so far and give us a better idea what you are trying to do?
Silver13
7-Jul-15 20:19pm
View
I have had this issue before, like virusstorm mentioned Console applications are not quite smart enough but you can trick it by "handling" your methods using perhaps Boolean's to indicate your Start or Ends with some if statements? Its not really clean but it could do what you are asking. And yes, you would need background worker to do this.
Silver13
1-Jul-15 21:02pm
View
You have to provide the data to your value BkCode with a get; set; method.
Silver13
28-Jun-15 22:05pm
View
You are right pwasser! It was simpler to have one string _text and append my data to it in a format i want then just do a one call to create and write to file at the end. It went from over 2 minutes to just 2 seconds. Thanks for the nudge, i needed it. Cheers.
Silver13
28-Jun-15 21:35pm
View
Ok, but there is not much to it.
The call is made by pressing the button on the form.
string _path = @"C:\Output.txt";
string _text = string.Empty;
for (int x = 0; x < 10000; x++)
{
_text = "This is line " + x.ToString();
_AppendDataFile(_path, _text);
_text = string.Empty;
}
Silver13
6-May-15 23:27pm
View
Thank you for your suggestion. This method is definitely interesting and shows potential. I am going to experiment with the code to get a prototype working.
Silver13
6-May-15 1:25am
View
Believe me it is not by my choice, the reason is that these images are a product of a certain organisation. And the ones that own this image would like to place as you call it "a pointless and distracting black sign" on every page of the image along with date and time as a mark. Whatever the reason it is, I thought It would presents a challenge. But I guess ill take your advice and call it a day. Thank you for the input.
Silver13
6-May-15 1:03am
View
What should I call it then? Do you have a suggestion for a solution?
Silver13
5-May-15 21:43pm
View
The project that I am working on requires me to take the tiff image and put text on each page as a watermark.
Silver13
5-May-15 21:41pm
View
Thanks for the tip, I have moved the unnecessary items out of the loop like you suggested, but I don't see the improvement. I am starting to think I am doing this wrong by putting the images in an array. Instead of pushing it though as a stream ... maybe a MemoryStream()?
Silver13
22-Apr-15 19:52pm
View
Hi Sergey, just an update, I have managed to figure out the resolution part. If you look at the code, just before you save the image: images[0].Save(destinaton, codecInfo, EncoderParams);
set the resolution of your image for this case to 200 dpi like this:
images[0].SetResolution(200, 200);
This value will now also show in the metadata of the created image.
Silver13
22-Apr-15 0:09am
View
Yes please, any information would be helpful to better understand this. Hopefully all this information will help others. But just out of curiosity is it possible to set that metadata to 200 dpi in this code? I am just curious as I already spent a bit of time researching this and no answer so far.
Silver13
21-Apr-15 23:17pm
View
I am creating a multipage tiff. However I now have an issue with resolution where it dropped to 96 dpi, but I want it as 200 dpi? Any advice?
Silver13
21-Apr-15 19:21pm
View
Deleted
I did miss mentioning that part. That got me to take a look a closer look at how I handle these images so I rewrote the code and now it works but there is a problem with resolution where it should be 200 dpi but in my case it dropped to 96 dpi. I am not sure how to fix that at this stage.
string type = "TIFF";
ImageCodecInfo codecInfo = getCodecForstring(type);
System.Drawing.Imaging.Encoder saveEncoder;
System.Drawing.Imaging.Encoder compressionEncoder;
EncoderParameter SaveEncodeParam;
EncoderParameter CompressionEncodeParam;
EncoderParameters EncoderParams = new EncoderParameters(2);
saveEncoder = System.Drawing.Imaging.Encoder.SaveFlag;
compressionEncoder = System.Drawing.Imaging.Encoder.Compression;
// Save the first page (frame).
SaveEncodeParam = new EncoderParameter(saveEncoder, (long)EncoderValue.MultiFrame);
CompressionEncodeParam = new EncoderParameter(compressionEncoder, (long)EncoderValue.CompressionCCITT4);
EncoderParams.Param[0] = CompressionEncodeParam;
EncoderParams.Param[1] = SaveEncodeParam;
images[0].Save(destinaton, codecInfo, EncoderParams);
for (int k = 1; k < images.Count; k++)
{
if (images[k] == null)
break;
SaveEncodeParam = new EncoderParameter(saveEncoder, (long)EncoderValue.FrameDimensionPage);
CompressionEncodeParam = new EncoderParameter(compressionEncoder, (long)EncoderValue.CompressionCCITT4);
EncoderParams.Param[0] = CompressionEncodeParam;
EncoderParams.Param[1] = SaveEncodeParam;
images[0].SaveAdd(images[k], EncoderParams);
}
SaveEncodeParam = new EncoderParameter(saveEncoder, (long)EncoderValue.Flush);
EncoderParams.Param[0] = SaveEncodeParam;
images[0].SaveAdd(EncoderParams);
If anyone has a tip on how to enforce 200 dpi resolution to this code I would appreaciate it.
Silver13
28-Jan-15 22:11pm
View
I had to test my idea first. I have provided my solution and offered an additional from a link.
Silver13
28-Jan-15 21:46pm
View
Thank you for the quick reply to my question. I am sorry that it was not clear, as this is only an experimental code and no where near perfect. Hence me asking questions about it. I am even open to suggestions which involve scrapping the whole thing for a more efficient model if you or anyone else has a suggestion.
However, while reading your message you made me think about the problem in a different way thanks to your statement:
"More importantly, how can you expect something good if you are writing code in so messy manner? Look, 6 fragments repeat the same code. You should never repeat such thing?"
You are correct, it is messy and not at all usable at this stage. Instead you have given me an idea on how to proceed, so in a way you have answered my question. Thank you.
Silver13
6-Nov-14 17:07pm
View
Asmx.
Silver13
3-Feb-14 22:19pm
View
I have considered this but in this case it cannot be avoided. Like I said the table contains fields such as client first names and if I was to search for someone named Alex I could have up to 5 people named Alex. I want to highlight all of them.
Silver13
23-Sep-13 1:19am
View
I been thinking about this problem all afternoon and i am wondering ifyou are reffereing to one image displaying all scrambled.. that is a real image (Screanshot), it is what i see when the conversion is completed. It starts to convert then becomes distorted and the rest is not even there. It is just to show what happens when i do it. That said i have done more investigation and may have found the cause of the problem. The original JPEG 2000 image is not encoded correctly in first place and some paramaters are missing as the encoding process was not done correctly by the third party software Kakadu. End bytes to show where the end of codestream is are missing. It must be a glitch in the original program that created the image or possible user that created them. The program i am making is working fine as i have tested it by trying out another jpeg 2000 image i downloaded from the google. The image converts without problems to Tiff.
Silver13
23-Sep-13 0:28am
View
I am shocked to see you think it is malware. This is a legitimate question and 2 images are jpeg hosted on tinypic.com. That said, i dont know what you saw when you accessed their website as simply copy and paste the address works for me and displays the images fine. I might have not linked their address correctly? This is my first post ever on this site. If this is an issue i will correct it by finding another provider to hold the images. If you have a suggesstion of a site i am open to suggestions.
Show More