|
Welcome,
Have you got any example how to put Bitmap (created during working of application) and than put it (embedded) in RichTextBox control.
Bitmap is created in the memory (not reading from file).
thx
|
|
|
|
|
Hi
I have tried to do something similar and there seems to be 2 ways:
1. Easy - place bitmap object in clipboard and paste to richtextbox. Problem that u use the clipboard and mite "lose" data that still needs to be there.
2. Hard - Create a RTF file in a word processor with required bitmap, save the file. Now add that to the Rtf of the richtextbox. This could coause many problems though
3. Ideal solution - Every stick together and make a proper WordProcessingTextBox with all the features we always wanted . Like highlighting
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
leppie wrote:
Hi
I have tried to do something similar and there seems to be 2 ways:
1. Easy - place bitmap object in clipboard and paste to richtextbox. Problem that u use the clipboard and mite "lose" data that still needs to be there.
Hmm I did't think about it... but how to copy bitmap from Form (for example I would like to write some kind of chart and put it into rtf)
leppie wrote:
2. Hard - Create a RTF file in a word processor with required bitmap, save the file. Now add that to the Rtf of the richtextbox. This could coause many problems though
In my case it couldn't be done.
leppie wrote:
3. Ideal solution - Every stick together and make a proper WordProcessingTextBox with all the features we always wanted . Like highlighting
That's cool. But unfortunately I don't have time to do it
(but maybe in future it is good idea
|
|
|
|
|
I am looking for something similar to a feature Delphi has, that allows you to
- create a "Data Module"
- add database components (connections, tables, views)
- use the data module in any form (it works with the visual tools too).
I can't seem to find anything similar for a Windows Forms C# application.
What I would like to do, is have one database connection always open, and available to any form.
It's quite trivial to do it in code, but how can you make the visual designer tools "see" this connection?
|
|
|
|
|
I try to write a .vsz file, but when I use it in vs.net, vs.net always told me "Could not run xxx.vsz file"!
I'm amumu, and you?
|
|
|
|
|
How do I detect, at runtime, what the .NET Framework Version is?
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
System.Version
I'm amumu, and you?
|
|
|
|
|
System.Version is a class that represents a version number; by itself it doesn't tell you the version number of the framework but System.Environment.Version will tell you the version of the CLR.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Hey, thanks for the reply, James. Apparently, though, the .NET Framework Version is not the same as the script directory that ASP.NET uses. What I mean, is that System.Environment.Version returns 1.0.3705.209, but the ASP.NET script files (WebUIValidation.js, etc.) are in a folder called 1_0_3705_272. Ideally, I'd like to be able to get this folder without having to enumerate its siblings, and look for the highest revision number.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
why are you trying to muck around with the asp.net script files?
|
|
|
|
|
I'm not trying to modify them or anything. I created a custom validator (that implements IValidator, but doesn't derive from BaseValidator), and was hoping I could just use the available script for client side validation, rather than have to rewrite my own.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
BaseValidator gets the path to the script files from the internal static System.Web.UI.Util.GetScriptLocation method, which gets some of its info from the internal System.Web.Util.VersionInfo.SystemWebVersion property.
GetScriptLocation looks up the "clientScriptsLocation" setting in the machine.config file. but that string has parameters which are filled in by SystemWebVersion.
You might be best off either using reflection to get to the GetScriptLocation method, or querying the .config file for the root path, and then scanning that folder for the highest version.
|
|
|
|
|
Hi, I have a little problem with the 'Clipboard' class. I am attempting to transfer data from the windows clipboard to a bitmap object and appear to be leaking memory. The following code placed in a button on a windows form will cause a significant amount of memory to be allocated and only partially freed. You must manually 'copy' an image onto the clipboard prior to running this code.
System.Drawing.Bitmap bm;
IDataObject iData;
iData = (IDataObject) Clipboard.GetDataObject();
for (int i = 0; i < 100; i++)
{
if (iData.GetDataPresent(DataFormats.Bitmap))
{
bm = (Bitmap) iData.GetData(DataFormats.Bitmap);
if (bm != null)
{
bm = null;
}
else Console.WriteLine("Bitmap was NULL");
}
}
If the 'bm=(Bitmap)...' line is commented out no memory will leak.
I have been using an approximately 512x512x32 BMP for my tests.
Note : This code is simply to test the leaking problem. The real code places a different image on the clipboard every time through the loop and then works with the data in the if (bm != null) {...} block.
|
|
|
|
|
How are you checking the memory use? There's nothing in your code that forces the bitmap to be freed, so memory is going to be hanging around until a GC happens.
You could call bm.Dispose() to free it early.
|
|
|
|
|
I have tried inserting a GC.Collect(); after the BM=null; line. This did not seem to have any effect. I also placed a GC.Collect(); after the entire loop ran to see if it cleaned up any - it did not.
I have also tried replacing the
'bm = (Bitmap) iData.GetData(DataFormats.Bitmap);'
with
bm = (Bitmap) new Bitmap(512,512); // or whatever that constructor is
This then worked - the memory fluctuated by a couple megs up and down but after the routine exited left no memory in use. This was even without a GC.Collect(); line in the routine.
Oh, I also did try bm.Dispose(); but this also did not free the bitmap.
Lastly, I am looking at the NT's task manager - not the most fine of memory gauges, but each bitmap I get uses about 1 meg of memory. A loop of 100 iterations will cause the task manager to show nearly 100 megs more in use.
Thanks for the reply!
|
|
|
|
|
Is it possible to develop a disk format application without depending on windows or dos format tools?
Jassim Rahma
|
|
|
|
|
I added a status bar and a panel to a form. I then set the panel's borderstyle to fixed3d (this way I can see all sides of the panel) and set the dock property to DockStyle.Fill.
The problem is that the panel gets tucked underneath the status bar. This can be fixed by right clicking the panel and selecting 'bring to front'. Unfortunately I will be adding the panel dynamically, so I need a way acheive the same effect of 'bring to front' via code.
Any help would be greatly appreciated.
Thanks,
Steve
|
|
|
|
|
Try:
myPanel.BringToFront();
The BringToFront() method is part of the Control class.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Duh ! I don't know why I thought bring to front could only be used from the IDE. Man, I feel stupid.
Thanks Nathan
|
|
|
|
|
Not stupid.... Just overworked
Glad, I could be of help.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Try changing the order or creation of the status bar and panel.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
That was the first thing I tried. I did every possible combination for creating and defining the two controls.
Thanks for the suggestion though
|
|
|
|
|
Hi,
Does anyone know if it is possible to call the Scheduled Task interface from C#. Its located here Start -> All Programs -> System Tools -> Scheduled Tasks. Once you Add a Scheduled Task and you get the properties of it -- this is the interface I would like to call. Is there a class in C# that will handle this. I have seen Symantec using this in their Norton AntiVirus program. Any help would be greatly appreciated since I need to do this in my program. Thanks
cAptHiDDeN
|
|
|
|
|
|
Yes very similar to this, but is there a way to called the actual design interface within windows without having to shell out into DOS. It would be nice to call the interface design within windows. There has to be someway to call this but I can not seem to figure it out. This is what I am trying to call: If you got to Start --> All Programs --> Accessories --> System Tools --> Scheduled Tasks. Click Add Scheduled Task and pick the options you want for your particular job. Once your job is add, click on it and get its properties. A window pops open showing you the job you just scheduled. This is the window, I am trying to call. Is it possible to call this either from a class library or a dll in windows? If this isn't possible, is there a way to call the actual wizard (Add Schedule Task)built into windows?
If anyone else might be able to provide me with some help, I would be greatful. Thank You.
cAptHiDDeN
|
|
|
|