|
stitchImage = new Bitmap(100000, BMPList[0].Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
|
|
|
|
Does it have to be done in WinForms? If you were to use WPF, the bitmap support in there doesn't use GDI+ and it's a lot more responsive.
|
|
|
|
|
It may be that it's the .NET version that is causing the problem: prior to V4.5 the Large Object Heap was not compacted, so even disposing of your objects may not free up the memory correctly.
If you can, it's worth a try at 4.5 or 4.5.1 / 4.5.2 and see if the problem goes away.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Interesting, i'll give that a try.
|
|
|
|
|
Hi,
I'm going to implement WebRTC using WebBrowser Control in C# Windows form application.
I attempted with EO.WebBrowser and CefSharp library, but I can't connect my webcam in their WebBrowser control.
Have you any suggestion?
|
|
|
|
|
if you have a tenvis camera then it comes with a program (Active-X control) to work in IE
VS Browser control is IE so it will work
Tenvis lets you opt in to viewing your camera from across the internet but be warned that even if you turn the option off it still kicks out across the internet and by-passes your DNS server so best to just block it in the routers firewall.
|
|
|
|
|
I need to copy an audio file from resources to the HD:
private void EnsureDefaultFileExists()
{
var outputFile = Path.Combine(FileSystemLocations.GetTempFilesDirectory(), "fc6sound.wav");
if (!File.Exists(outputFile))
{
var targetAssembly = Assembly.GetExecutingAssembly();
var resourceName = "fc6sound.wav";
using (Stream stream = targetAssembly.GetManifestResourceStream(targetAssembly.GetName().Name + "." + resourceName))
{
if (stream == null)
{
throw new Exception("Cannot find embedded resource '" + resourceName + "'");
}
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
using (BinaryWriter sw = new BinaryWriter(File.Open(outputFile, FileMode.Create)))
{
sw.Write(buffer);
}
}
}
}
This isn't working. The exception is thrown. I've tried it with and without the ".wav". Anyone see what's wrong?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
The resource name is case-sensitive and has to be fully qualified, that is, if you've put the resource into a sub-directory of the project, you have to include the name of the directory as quasi-namespace. E.g.: "MyAssembly.MyResourcesDir.fc6sound.wav"
Or you can enumerate all embedded resources with Assembly.GetManifestResourceNames() and simply copy the resource name from there.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I tried using Assembly.GetManifestResourceNames() and I got back an array of 33 resources:
var resources = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
using (var sw = new StreamWriter(@"C:\someplace\resources.txt", true))
{
foreach (var resource in resources)
{
sw.WriteLine(resource.ToString());
}
}
I get this:
FALCON6.g.resources
FALCON6.DownloadDialog.resources
FALCON6.ucAdvancedSettingsConfig.resources
FALCON6.ucConfigureBluetoothSensor.resources
FALCON6.ucBluetoothPairing.resources
FALCON6.ucBluetoothPairingItem.resources
FALCON6.ucCOPSoundSelector.resources
FALCON6.ucConfigureFalcon6Sensor.resources
FALCON6.ucConfigureWiredSensor.resources
FALCON6.ucCOPIconSelector.resources
FALCON6.ucCOPSettings.resources
FALCON6.ucFC6ActivityListContainer.resources
FALCON6.ucFC6Sensor.resources
FALCON6.FALCON6MainForm.resources
FALCON6.Properties.Resources.resources
FALCON6.ucCameras.resources
FALCON6.ucConnectMain.resources
FALCON6.ucConnect_Prof.resources
FALCON6.ucConnect_Profs.resources
FALCON6.ucFC6Activity.resources
FALCON6.ucFC6SensorPictureBox.resources
FALCON6.ucFC6Timeline.resources
FALCON6.ucGSMConfig.resources
FALCON6.ucImageResizer.resources
FALCON6.ucImageViewer.resources
FALCON6.ucIPAddressConfig.resources
FALCON6.ucLiveView.resources
FALCON6.ucRow.resources
FALCON6.ucTable.resources
FALCON6.ucMapCompositeExtended.resources
FALCON6.ucUploadSettings.resources
FALCON6.ucVideo.resources
FALCON6.ucVideoPlayer.resources
I have no clue which of these is right, and I have no idea how to use it.
Sascha Lefévre wrote: and simply copy the resource name from there.
.. I don't understand.
If it's not broken, fix it until it is
|
|
|
|
|
Hm.. did you actually select "Embedded Resource" as the Build Action for your wav-file?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
1 - I double click the "resources.resx" node in the Solution Explorer. The resources view opens.
2 - I select "Audio" from the type dropdown at the top
3 - I right click the audio file. There is no option to embed.
4 - I bring up properties and drop down the "Persistence" option. I selected "Embedded in .resx" option.
I don't see any "Build Action"
If it's not broken, fix it until it is
|
|
|
|
|
OK, I got it... I added the file to the SOLUTION, not the RESOURCES node, then set it to embedded, and it's resource name is "FALCON6.fc6sound.wav"..
With that, my code above now works.
If it's not broken, fix it until it is
|
|
|
|
|
Yes, that's what I assumed because you already used GetManifestResourceStream(..) in your code.
This is how you would access it from the resources.resx:
System.IO.UnmanagedMemoryStream stream = Properties.Resources.fc6sound;
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
OK, good to know.. Thank you
If it's not broken, fix it until it is
|
|
|
|
|
You're welcome!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Another useful little titbit, thank you!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Cheers!
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
tell me about patterns with simple examples
|
|
|
|
|
|
Try this: How to: patterns[^]
Or did you have a different pattern in mind? You have to be specific, you know!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I just laughed so loud I frightened the cat! Have a 5 for making my day
|
|
|
|
|
There's a pattern that people who post here for the first time often don't ask good questions.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Your first "go to" pattern should be "Google".
|
|
|
|
|
A pattern is a description of a way to solve a common design problem. The behaviour and terminology is formalised, so that people use the same terms when describing these solutions. There are many great resources available for learning about patterns. The classic example is the Gang of Four (GoF) book[^]. It's a bit hard to follow when you're first learning it, so I'd recommend something like the Head First Design Patterns book. Beyond that, take a look at dofactory.com[^]. They have lots of examples of patterns.
|
|
|
|
|
It's just a feeling but he is talking about a pattern for a reg-X to use in a match
|
|
|
|