|
Hi everybody!
I would like to display the image formats (. gif) in crystal reports ,
but the Solution Knowledge Base of Crystal Care Thechnical Support :
"{Crystal Reports reads the following SQL BLOB formats:
· TIFF
· BMP
· JPEG
· PNG
Crystal Reports does not support:
· gif
· TIFF files that use LZW compression}"
What is the best way to do it?
I use c#.
Thanks in advance... 
|
|
|
|
|
utf-16 or utf-8 or encode or unicode related stuff?
about string to byte converter,whatever such things?
I search google for encode and unicode,but did not get some useful info.
Please give me some guide.
Thanks.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
zhoujun wrote:
Please give me some guide.
System.Text.Encoding namespace
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
NO.I did not understand much about that namespace,
So I ask for help.
Did vs.net doc explain it in somewhere?
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
I am writing a simple graphics game that creates a 20x20 board of different color Squares that have can be the following colors: Blue, Green, or Red now i know how to get a basic random number with in a range
Random rnd = new Random();
rnd.Next(4)
i have this in a switch statement for each indiviual block class when it is created to assign a random color to the block;
now i know the basic call to Random uses the system clock as the seed to create the number but the problem is the 20x20 board takes no time at all to create and draw durring program execution that instead of a nice chaotic 3 color checker board i get a series of stripes that break to the next color. it looks kinda like this
RRRRGGGGGRRRRBBBBGG
RRRRGGGGGRRRRBBBBGG
RRRRGGGGRRRRBBBBBGG
RRRRGGGGRRRRBBBBBGG
RRRRGGGGRRRRBBBBGGG
RRRGGGGGRRRRBBBBGGG
RRRGGGGGRRRRBBBBGGG
ok so you get the idea not much of a challenge for a game!
this is what i want
RGBRBBRGBRGRBBGR
BGRBRRBGGRBBRBRB
GRBBGRBGBGRRBGRB
ok again you get the idea.
now how do i make the random number well more random i guess
any help is greatly appreciated
Ryan
|
|
|
|
|
What about using your random number as the seed for another random number? After all, that would mix it up a bit.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Post some more code, especially with regards to the switch statement. Where you specify Random rnd = new Random(); is important.
ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff
|
|
|
|
|
here's the code for the problem in question
<br />
Class BlockClass<br />
{<br />
private enum BlockColor<br />
{<br />
BLUE,<br />
GREEN,<br />
RED<br />
}<br />
<br />
<br />
private BlockColor ItsColor;<br />
<br />
public void AssignColor()<br />
{<br />
Random rnd = new Random();<br />
switch (rnd.Next(4))<br />
{<br />
case 1 :<br />
this.ItsColor = BlockColor.BLUE;<br />
break;<br />
case 2 :<br />
this.ItsColor = BlockColor.GREEN;<br />
break;<br />
case 1 :<br />
this.ItsColor = BlockColor.RED;<br />
break;<br />
}<br />
<br />
public BlockClass(Graphics InGraphics, <br />
int inSpeed,<br />
Point inLocation,<br />
bool inTopRow)<br />
{<br />
this.AssignColor();<br />
}<br />
}<br />
basically AssignColor() is only used as part of the object's construction it is called once per BlockClass that is created. I choose to use an enumeration so it would be easy for me to do redraw using another switch statement to either draw the block using basic graphics routines like DrawRectangle() or load a specific image from an imagelist containing the 3 color blocks plus a blank white block for redrawing purposes
to give you an idea how this class is used:
<br />
class BlocksClass<br />
{<br />
ArrayList TheBlocks = new ArrayList(20);<br />
<br />
public void LayoutBlocks()<br />
{<br />
for(int x = 0;x < 20;x++)<br />
{<br />
ArrayList YArray = new ArrayList(20);<br />
for(int y = 0;y < 20;y++)<br />
{<br />
BlockClass Block = new BlockClass(this.Gfx,<br />
this.speed,<br />
new Point((x * 7) + 3,(y * 7) + 3)),<br />
(y == 0))<br />
YArray.Add(Block);<br />
}<br />
this.TheBlocks.Add(YArray)<br />
}<br />
} <br />
}<br />
so basically the program calculates a 20x20 playing board with 7x7 pixel boxes
by filling in the Y rows of a specific X column and then moving on to the next X column and repeating (i did this cause part of the program needs to be able to delete a square and cause those above it to drop down to replace it (figured i set up the array like this it would be easier to parse for this event)
ok now i'm done typing like... working at 3am does that to me i can't shut up i mean look at me...
|
|
|
|
|
The problem is that every time you call AssignColor, a new Random object is generated and is seeded using the current system time. This happens EVERY time you call AssignColor; so what happens is you call it the first time, it seeds the RNG (Random Number Generator), gets a value, then goes to the next block, seeds the RNG (using the same system time because not enough time has elapsed, spits out the same number, etc...
Solution: Instead of creating more than one Random object, make the Random object a static member of the BlockClass class; and use it like so...
class BlockClass {
static Random r = new Random();
public void AssignColor()
{
switch(BlockClass.r.Next(4))
{
}
}
} Doing so ensures that only one instance of the Random class is generated so you can actually pull more than one number out of it.
James
- out of order -
|
|
|
|
|
thanks james
Mattilda: "Is life always this hard?... Or is it just when your a kid?
Leon:"....Always like this."
|
|
|
|
|
One approach you might try is this:
use a wide span of numbers going from something like 0.00001 --> 0.99999
then when you get a next number, multiply this by your max number + 1
and scrunch it to an integer to lop off the extra decimal places.
By applying this approach you should give your random generation a wide enough spread that it jumps all over the place. If you are just doing a Random from 1-->4 you do not have a very wide spread to allow for wide swings in changes. You would do a multiply of max+1 since your number never reaches 1.0 and integer math should keep the (max+1)*rnd(next) actually exceeding the max value.
Game on Dude.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
i have executed a thread and i want to check if it is alive then make it dead.
how to do it?
if there are more then one thread then how to do it?
r00d0034@yahoo.com
|
|
|
|
|
What about the ThreadState propery?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
i want to kill a group of threads after some condition?
how to do that?
r00d0034@yahoo.com
|
|
|
|
|
Not really sure where to ask this one, so I'll clutter the boards up here...
Is there a way to tell a TabPage on the TabbedGroup control to close or hide? I want to be able to show/hide or create/destroy the TabPages according to user selections on a menu (ie, uncheck a menu item and the corresponding window goes away). Show/hide would be ideal, but the windows don't seem to be responding to Hide() calls once created. Has anyone run into this issue?
I get all the functionality I need out of this set of controls (which are top notch, BTW)...just this one final hurdle to overcome!
m_mond
|
|
|
|
|
I would suggest you ask this in the articles own forum as the author will receive an email notification and can possibly help you quicker
"I dont have a life, I have a program." Also, I won't support any software without the LeppieRules variable.
|
|
|
|
|
I'm ready to throw my PC through the wall. I have two panel controls in a Windows Forms application that I'm writing. Both are set to full docking, and placed on the right side of a splitter bar, so the share the same space, but only 1 is visible at a time. Docking is set to full for both. My problem is that the Visible property is NOT setting for one of the panels. As I step through my code, calling Panel.Visible = True does nothing; looking at the property in the debugger shows that it is STILL false, and no exception is thrown.
Any ideas?
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Wow. I've never seen that problem before. Can you post some code?
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Well, it's in theory anyways, very simple:
private void trvHierarchy_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if (((string)e.Node.Tag).IndexOf("Folder:") >= 0)
{
if (pnlHoursList.Visible = true)
{
CreateSummary();
pnlHoursList.Visible = false;
pnlUsageSummary.Visible = true;
}
else
{
pnlHoursList.Visible = true;
pnlUsageSummary.Visible = false;
}
}
}
CreateSummary just fills a listview on pnlUsageSummary. I can show or hide pnlUsageSummary, but I can't seem to set pnlHoursList's visibilty.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
1) You can simplify your code by doing this:
if ((((string)e.Node.Tag).IndexOf("Folder:") >= 0) && (pnlHoursList.Visible == true))
{
CreateSummary();
pnlHoursList.Visible = false;
pnlUsageSummary.Visible = true;
}
else
{
pnlHoursList.Visible = true;
pnlUsageSummary.Visible = false;
}
And then, what you should probably do is set the visibility of pnlUsageSummary to false before you set the other to true...
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
I have a COM+ object,I want to use it in a client.When I use it I got an unhandled error that my component should be in Current Contex but it is not.Should I set anything on my computer when using COM+?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
The first question is more to the IDE than anything else. I noticed that you can add all types of files into a project, including XML and XSLT files. Is there any advantage to this and how do I programmatically access these files. For example, if I have three XSLT files in my project, how do I get at these to execute transforms against the XML file passed to me?
Second XML question: Once I have created an XMLDocument file, I want to generate a schema for the file automatically. I cannot find a method or docs on doing this. Any help in this direction would be great.
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
theRealCondor wrote:
Is there any advantage to this
If you paste text into a file it knows is XML, it will HTML encode it. This is sometimes good, sometimes a pain.
theRealCondor wrote:
For example, if I have three XSLT files in my project, how do I get at these to execute transforms against the XML file passed to me?
I dunno how to load them from resources, I presume you still need to load from disk, but having them in the project makes them easy to get to.
theRealCondor wrote:
I want to generate a schema for the file automatically. I cannot find a method or docs on doing this. Any help in this direction would be great.
I wrote an XML wrapper in C# for WDJ magazine ( it's not been printed yet ), and I looked into this. I thought you need to do it yourself, but I'm learning ADO at the moment, and a dataset can create a schema for you in XSD format, and I believe you can fill a DataSet from XML, so that might be an answer. Any auto generated schema would of necessity be imperfect, unless all your nodes always appear, and always appear the same number of times.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
a dataset can create a schema for you in XSD format
CG, I thought this new MSDN magazine article[^] might be well worth a read to you.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Yum - thanks. I have the issue, but had not noticed this, which means without your assistance, I never would have. I'll dig it up tonight.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|