|
if possible antbody help me... do no wat error it contains
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MainClass
{
public static void Main()
{
int tokenindex = 0;
int cntTokens = 0;
int iSymbol = -1;
int prevDictSymbol = -1;
char[] strToken = new char[512];
int i=0;
string[] arr = { "Hello", "World" };
while (arr[0] != null)
{
tokenindex = 0;
while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';')
&& (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0')
&& (arr[0] != '&') && (arr[0] != '-'))
strToken[tokenindex++] = arr[0];
arr++;
strToken[tokenindex] = '\0';
}
Console.WriteLine(" The Token is:", strToken);
Console.WriteLine("The Length of strToken", strToken);
}
}
the quieter u become more u hear
|
|
|
|
|
What sort of error? Compiler error? Not the data you excepted?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hmmm.. compiler error
the quieter u become more u hear
|
|
|
|
|
Okay, looks like you actually don't want help.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
his footer says
"
the quieter u become more u hear
"
he's absolutely right: don't give all the info too soon
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
It's probably because all your code is in bold and not formatted correctly for review.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you can't see the problem, you really need to drop the C# class your taking right now. Intellisense lights that code up like a freakin' Christmas tree.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
BTW, this is the most frakked up homework assignment on the planet. Does your instructor really want you to use a character array to hold the extracted word?
I rewrote your code so that it would work, but I don't know if I want to give it to you because it has the very real possibility of helping you pass the course, and I don't think we need another clueless programmer running around writing crappy code.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Please nooo not another clueless programmer! there are enough in the world at the moment, can we put them all in one place and just push the barge away so they float away out of harms way.. preferablly with no internet connection
|
|
|
|
|
Well in amongst all the flames and elitist comments. I'll assume your a complete n00b and help you out a bit. but I gotta be honest, it was glaringly obvious.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MainClass
{
int tokenindex = 0;
int cntTokens = 0;
int iSymbol = -1;
int prevDictSymbol = -1;
char[] strToken = new char[512];
int i=0;
string[] arr = { "Hello", "World" };
public static void Main()
{
while ((arr[0] != null)&amp;(arr[0]!= ' ')&&(arr[0] != ',')&amp;(arr[0] != ';')&&(arr[0] != '/')&&(arr[0] != '#')&&(arr[0] != '\0')&&(arr[0] != '&')&&(arr[0] != '-'))
{
tokenindex = 0;
strToken[tokenindex++] = arr[0];
arr++;
strToken[tokenindex] = '\0';
}
Console.WriteLine(" The Token is:", strToken);
Console.WriteLine("The Length of strToken", strToken);
}
}
aaarghhh! too many ands. That's as much am I'm going to do, the rest is up to you.
<div class="ForumMod">modified on Monday, January 26, 2009 2:51 PM</div>
|
|
|
|
|
I am using crystal reports in my project. Every thing is fine but when i am trying to export report into any other format it gave me an error "LOAD FILE FAILED". Please help me how i can resolve this error.
I am using VS2008, Crystal Report 10 and sql2005
thanks
|
|
|
|
|
|
|
This creates a circular PictureBox, I'm sure you can adapt it to suit.
PictureBox CreateCircularPicture(Image image)
{
PictureBox pictureBox = new PictureBox();
float smallestDimension = image.Width;
if (image.Height < smallestDimension)
smallestDimension = image.Height;
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
myGraphicsPath.AddEllipse(0, 0, smallestDimension, smallestDimension);
pictureBox.Region = new Region(myGraphicsPath);
pictureBox.Image = image;
pictureBox.Height = (int)smallestDimension;
pictureBox.Width = (int)smallestDimension;
return pictureBox;
}
Controls.Add(CreateCircularPicture(Image.FromFile(@"C:\background.jpg")));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I Have this error at when i try to edit the row
|
|
|
|
|
You need to use SelectedIndex remembering that a listbox is zero based so SelectedIndex(0) would be the first item in the list and SelectedIndex(10) would be the ninth item in the list.
|
|
|
|
|
hi evryone
i have some unsolve problem in C#
1. how can i print picture in crystal report (from imag type in database)
2. how can i send and resive List<> to function ?
3. how can i change date format in WinCE (for ex. en-US)
thank's for any help
|
|
|
|
|
1 - Load it into a byte array. Crystal report can render it as image.
2 - Do you mean this?
List<Foo> AcceptAndReturnListFoo(List<foo> foo){
}
|
|
|
|
|
When I open a page in the
WebBrowser I see appear notice board:
Security information .Toi want programmed to automatically remove this notice I do? I'm using language C #. NET
|
|
|
|
|
Hello everyone,
I'm developing an application that is similar to Windows Explorer. I'm using a ListView control to display files and folders along with their icons. Now, icons for files can be retrieved using standard shell functions ExtranctIcon and ExtractIconEx. But my question is that how can I get that translucent effect as used by Windows Explorer for hidden and system files.
I searched google and found the following code snippet:
public static Image SetImageOpacity(Image imagePic, float imageOpacity)
{
Bitmap bmpPic = new Bitmap(imagePic.Width, imagePic.Height);
Graphics gfxPic = Graphics.FromImage(bmpPic);
ColorMatrix cmxPic = new ColorMatrix();
cmxPic.Matrix33 = imageOpacity;
ImageAttributes iaPic = new ImageAttributes();
iaPic.SetColorMatrix(cmxPic, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
gfxPic.DrawImage(imagePic, new Rectangle(0, 0, bmpPic.Width, bmpPic.Height), 0, 0, imagePic.Width, imagePic.Height, GraphicsUnit.Pixel, iaPic);
gfxPic.Dispose();
return bmpPic;
}
Now my code calls this method as follows:
lViewVFSBrowser.LargeImageList.Images.Add(imageKey, SetImageOpacity(iconL.ToBitmap(), (float)0.7));
but all I get in return is an icon with a bluish background as shown here:
http://www.geocities.com/ankit_incredible_2006/problem.JPG[^]
|
|
|
|
|
[Edit] It looks like the same source after rereading the code you posted! Could you let me have the link so I can make sure I give credit in the code.
I think you need to up your opacity value[/Edit]
[Edit2]Ok, found the original here[^][/Edit2]
I've looked through all the icons in every file in the System32 folder and the hidden style icons aren't there, so I guess that Windows uses some overlay and/or transparency trick to do it.
This should work - it's an altered version that I found on the web some time ago, can't remember the source.
Opacity = 0 to 255, works fine with .ico files.
public Image AdjustImage(Image image, float opacity)
{
Bitmap bitmap = new Bitmap(image.Width, image.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
ColorMatrix matrix = new ColorMatrix();
matrix.Matrix33 = opacity;
ImageAttributes attributes = new ImageAttributes();
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
g.DrawImage(
image, new Rectangle(
0, 0, bitmap.Width, bitmap.Height),
0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
}
return bitmap;
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanks Dave for you time, but this method is exactly the same as the one I posted. Still I tried it, and used higher values for opacity (0 ~ 255) but the result is still the same.
|
|
|
|
|
Yeah, I realized that after I posted it - hence the edits!
I think it's something to do with the way the ListView renders it as it works fine elsewhere. I'll keep playing, there has to be a solution.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Actually, it appears it's the ImageList that's causing the problem.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi Dave,
I got it working correctly after a few hours of . The information from Joe Pardue's articles on transparency and alpha blending got me on the right track. Really they are excellent articles. I'd recommend reading them to all those who want to get a grip on graphics processing concepts.
Transparency Tutorial with C# - Part 1[^]
Transparency Tutorial with C# - Part 2[^]
Transparency Tutorial with C# - Part 3[^]
All that was needed was this little modification:
public static Image SetImageOpacity(Image image, float opacity)
{
Bitmap bitmap = new Bitmap(image.Width, image.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
g.FillRegion(new SolidBrush(SystemColors.Window), new Region(new Rectangle(0, 0, image.Width, image.Height)));
ColorMatrix matrix = new ColorMatrix();
matrix.Matrix33 = opacity;
ImageAttributes attributes = new ImageAttributes();
attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
g.DrawImage(image, new Rectangle(0, 0, bitmap.Width, bitmap.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes);
}
return bitmap;
}
Originally the method did the following:
1. Create a new Bitmap object.
2. Create a new ColorMatrix object and set the alpha element (3,3) to the desired value.
3. Construct a new ImageAttributes object, associate the ColorMatrix with it, and then use this whole information to draw the input Image over the new Bitmap object.
The problem, as far as I understand now (after reading Joe's articles), was that the method was trying to draw the source image over an empty bitmap (black colored bitmap). Thus, after applying the transformation, the image goes dark instead of fading into the background color.
Now the line which I added, paints the destination bitmap with the background color of the Window, before painting the source image, so that when it is blended with the source image, the source image appears blended into the background color.
That's it.
And here's the difference:
Before[^]
After[^]
|
|
|
|
|