|
first: thanks for your time and helping me.
i appreciate that.
You're right. There is something wrong with tha graphicsPath-Data. I am not sure what this could be.
Is there a problem with storing a GraphicPath-Structure in an ArrayList? Because that is what pfadListe is.
I draw some paths with the mouse on the screen and store them in an ArrayList. Afterwards i wanna do some transformation with the paths.
|
|
|
|
|
I just stored the GraphicsPath-Object in the ArrayList as a reference, what was not clear to me.
so, when i did a reset on the path to store the next drawing-action in it, i also deleted the data in the pfadListe.
shame on me.
|
|
|
|
|
Hello, I have a question. I have a 2D array [372,4], the first bit looks like this:
0.07 0.11 0.21 0.34
1.12 0.77 1.17 1.1
0.24 0.11 0.21 0.37
2.53 2.11 3.24 3.07
0.69 0.49 0.32 0.52
2.04 1.72 2.26 2.01
0.01 0 0 0.06
I would like to add the columns together so I get one single column. If I had a fixed array of the size I mentioned, I would not have a problem, it would look something like:
FD[i]=FD[i,0]+FD[i,1]+FD[i,2]+FD[i,3]
no problem. However, I would like to be able to have a variable for my number of columns, so then my summation would look something like:
FD[i]=FD1[i,0]+FD1[i,1],FD1[i,2]+.....+FD1[i,n-1]+FD1[i,n]
and I am not sure how to or if it is possible to program this. Any clues? Thanks a bunch!!
|
|
|
|
|
Use a list like an ArrayList for each line, then enumerate the list and keep a running sum. How you do that you need to explore, being that this looks like a class problem that you need to figure out and understand.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Where can I find information on this? This is a project for my job. I am learning to program as I go.
|
|
|
|
|
http://msdn.microsoft.com/netframework[^]. For all SDK documentation go to http://msdn.microsoft.com/library[^]. If you've installed Visual Studio .NET with the default settings, the .NET Framework SDK is also installed and you should have a "Microsoft .NET Framework SDK" program group under Start->Programs which you can read, too.
All you need to do is look-up ArrayList (or IList to see other implementations) and read the documentation. If you're new to programming with .NET, I suggest you pick up a good book that teaches .NET and OO design and browse the Class Library[^] to get a glimpse of all the available classes in the .NET BCL (base class library).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
an article from Joel Brandenberger, which discrips how to use simple Remoting, but there are questions ...
first the link to the article:
http://codeproject.com/csharp/RemotingWinApp.asp[^]
he uses 3 projects:
- a Server Application
- a DLL with the Interface declaration
- a Client Application
in this case it works fine but this project is designed for an local or an intranet application...
i need a way to use it at the internet.
i know it would work too, but i have to copy the DLL with the Interface declaration to all Clients.
My ServerApplication should be able to load unknown DLLs and provide them with remoting. So its not user friendly to copy new DLLs to the ClientApplication for every changing on the ServerApplication...
I thought of a possibility to load DLLs over Internet ...?
like
LoadDLL(http://server.tld/Application/AddOns/Interface.dll)
i hope you understand my problem, if not ask ^^
Copyrights © 2003 by Paebbels.net
|
|
|
|
|
i thought over this again and again and i remembered that it was possible in VB 6.0 with COM to set up a ActiveX-DLL-Server this DLL runs on the remote mashine and the cliend had full access to the dll (if i read the book in the right way... Developing COm and AXC with VB 6.0 - Dan Appleman)
but how can i build it in .NET? (VC# .NET or VB .NET)
Copyrights © 2003 by Paebbels.net
|
|
|
|
|
Hey!
I have tryed to find the HttpChannel class by this:
using System.Runtime.Remoting.Channels.Http;
But my Visual Studio 2003 is marking Http. If i Only write :
using System.Runtime.Remoting.Channels.
There will not show some options(like Http).
Is there somthing that i have to make to get this class? i have tryed to write
System.Runtime.Remoting.Channels.http.HttpChannel
but this does not work.
//Jimmy
|
|
|
|
|
Your project must reference the "System.Runtime.Remoting.dll" in order to use this type.
www.troschuetz.de
|
|
|
|
|
Thanks alot, didnt find this in th MSDN but i maby seartch to bad
//Jimmy
|
|
|
|
|
It's quite simple if you know the trick, but it's rarely mentioned. It took me almost a day to find that out
You can find this information at the bottom of each type's MSDN topic.
www.troschuetz.de
|
|
|
|
|
It's no trick, that's just the way it is. Just like in C/C++ you can reference types if you don't include the headers (though that's more analogous to using in C# or import in Java), and you can't link without referencing certain libs. In Java you can't compile without having classes in your class path. In VB you can't use an object if you don't reference the typelib and have the object's class registered on the system. The list of examples go on.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Yeah, I know it's not really a trick. Maybe this term was a bit inappropriate.
I meant that you have to know how you can reference the libraries and where you can find the information, which library has to be referenced. It's slightly different in each programming language and IDE, so you have to know "the trick" how to do it.
www.troschuetz.de
|
|
|
|
|
Why not just read the class library documentation and look at the bottom of the page that describes the class (or other type) itself? It will tell you what assembly in which the type is defined.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I know that.
But you see, that's exactly what I meant. If you know what to do, it's so easy that you take this for granted. But if you don't know, it's not such a natural thing.
www.troschuetz.de
|
|
|
|
|
Hi,
I want to change the color and width of my panel's border.
I created a class which inherits from panel, and override the onPaint() method. In that method, I called to ControlPaint.DrawBorder().
When I debug it,I see that it enter the function and perform the ControlPaint.DrawBorder(), but I don't see any change in the color of width of the panel border.
I attached the code.
Please help..
thanks
y.
public class BorderPanel : Panel
{
private Color m_borderColor;// The color of the border
private int m_borderWidth;//the width of the border
private BorderStyle m_BorderStyle;//the border style
public BorderPanel()
{
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
int borderWidth = 1;
Color borderColor = Color.Blue;
ControlPaint.DrawBorder(e.Graphics, new Rectangle(100, 100, 500, 100), borderColor,
borderWidth, ButtonBorderStyle.Solid, borderColor, 15,
ButtonBorderStyle.Solid, borderColor, 15, ButtonBorderStyle.Solid,
borderColor, 15, ButtonBorderStyle.Solid);
}
//Property of the border color
public Color BorderColor
{
get
{
return m_borderColor;
}
set
{
m_borderColor = value;
}
}
//Property of the border width
public int BorderWidth
{
get
{
return m_borderWidth;
}
set
{
m_borderWidth = value;
}
}
//Property of the border Style
public BorderStyle PanelBorderStyle
{
get
{
return m_BorderStyle;
}
set
{
m_BorderStyle = value;
this.BorderStyle = value;
}
}
|
|
|
|
|
Off-hand I'd say you're trying to draw the border outside the client area. Those coordinates (which, BTW, you shouldn't hard code for something that can be dynamically sized) are relative to the control's (Panel 's) upper-left corner. If you're panel is smaller, you won't see the border.
If even you use the Panel 's Bounds property, you'll still have a problem based on the direction of the path. IIRC, you'll see the top and left borders but not the right and bottom borders (because of culling). You'll need to shrink the Rectangle by the width of your pen on both the right and bottom sides.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I changed the coordinates to get the bounds of the panel, but it still doesn't work.I see the border of the panel ,but with default values - always with color black and width 1 (without considering the values I gave). I'm working with .Net designers,Can this be the reason for the problem? I can't find any reason that it doesn't work.
I tried the same thing with label (that doesn't work with designer) and it worked perfect.
Thanks,
|
|
|
|
|
In order to override what the designers do - which are going to draw their own borders at design-time - you need to implement your own designer and decide what gets painted and how. Read Enhancing Design-Time Support[^] in the .NET Framework SDK - especially those topics about designers - for more information.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi
If i copy both text & image with the same selection (e.g copying some text followed by an image from a word document), can I get the data from the clipboard seperated (i.e. is there some way to recognise that certain part of the clipboard object is text & the rest of it is an image??)
Anxiuos to get the answer
Thanx!!
|
|
|
|
|
You're about to venture down a road that will require a lot of reading.
The clipboard and drag-n'-drop functionality use OLE heavily. If you copy both text and image, it really matters how they were packed into the IDataObject (the native interface, not the managed System.Windows.Forms.IDataObject interface) and if you can get it out. Since the .NET BCL doesn't expose all the types necessary for full drag-n'-drop, you're stuck with what the .NET BCL does expose (like getting RTF, text, an image (separately), and a few more things) or writing a lot of P/Invoke calls and declaring and implementing a lot of interfaces declared natively.
So, if you want the easy road, please tell me what application you copied text and image(s) from. If it was Word or WordPad or something similar, chances are that it copied multiple formats including RTF, which .NET supports (see the DataFormats class, specifically the DataFormats.Rtf field).
If you want to get data from the clipboard, use the Clipboard.GetDataObject static method.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am using the Windows API to get ICO from a file. I place that image in a PictureBox. I wan't to save that image to a Jpeg so I use the the PictureBox.Image.Save(strFile,ImageFormat.Jpeg) method and it does save but the background is black. I would like to control what color that background is.
Thanks,
Cyber
|
|
|
|
|
Since JPEG doesn't support an alpha channel (ever considered saving as a GIF or PNG instead?) and you can't just say "set a background color". You can make colors transparent, but that's not your problem (quite the opposite, in fact).
Instead you'll need to parse the ICO format that is documented in http://msdn.microsoft.com/library[^] to get the palette, then get the transparency mask (IIRC, it's the first color in the palette). Finally, use Bitmap.LockBits , enumerate each pixel and use Bitmap.GetPixel to determine if that color is the same as the mask, then use Bitmap.SetPixel to set the color for the transparent pixel. When you're all done, use Bitmap.UnlockBits and save the image.
Another way is to create a Bitmap of the same size, set the background color, then get a Graphics object for the Bitmap and draw the icon onto the new bitmap. Save it as whatever format you like.
Honestly, saving this as a GIF or PNG (supports true alpha channels; GIF supports only masks and only 256 colors) would be much easier and are also widely used formats.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all,
I have created an application in which i use the window form's Autoscroll feature to scroll the window. Within the form's Paint event handler i am drawing some objects on the form. When i scroll the window using the scroll bar, all the objects are getting scrolled properly. I have a ruler, which is drawn on the top of the form. This should not get moved while scrolling the window using the scoll bar..How can i always fix it (the Ruler) to top of the client area of the form .. Please give any input....
thanks,
Pradeep
|
|
|
|
|