|
So Any images can not comrpess wiht huffman or rle ?
|
|
|
|
|
You have to cherry pick the image. Most image formats are already compressed and will not compress further with huffman and/or RLE.
Stop looking at the image itself and start looking at the data in the file if you want to look at how you're going to compress what has already been compressed.
In a compressed image, there are no "run lengths". They've already been compressed, so RLE isn't going to do anything at all. Also, Huffman, or some derivative of it, has probably already been used on the image so that's not going to get you anywhere either.
The algorithms you've chosen will only work on uncompressed formats, like .BMP.
|
|
|
|
|
How to compress :BMP extension picture wiht huffman.What do ı need do ?
|
|
|
|
|
Instead of using characters, you convert your Huffman code to use bytes. The algorithm really doesn't change.
|
|
|
|
|
You have asked variations on this question since the end of October. Do you think the answers will change?
This space for rent
|
|
|
|
|
I want to know how to compress the image in the uncompressed form. These algorithms are text based. Base64 does not work. There must be another way. You are asking me to repeat the questions instead of helping me.
|
|
|
|
|
I'm not asking you to repeat the questions; I'm saying that the answers you get aren't going to change just because you ask them again. Apart from bitmaps and RAW files, graphics files tend to be compressed which means that you're not going to get the benefits you think you're going to get. You do understand graphic file formats don't you? If not, I suggest that you need to go and read up on them before you try anything else.
This space for rent
|
|
|
|
|
|
|
You really aren't listening to anything we tell you, are you?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Because you didnt show me how to do that.
Bitmap is not compressed.Bitmaps can be compress with huffman but how why dont u understand me ?
|
|
|
|
|
Image files are just streams of bytes, so you can compress them with any of the compression methods. The point that people are trying to make is that it is largely not worth it since so many image types are already compressed. And the rest tend not to compress well because of the structure of the data. If you really want to prove this then try it with a few files of your own and see how much you can compress them.
|
|
|
|
|
I did not know this. That's something interesting I learned today.
This space for rent
|
|
|
|
|
It makes sense when you think of the pixel density on some of the cameras now.
The uncompressed file size from this beast: Canon 120MP DSLR Shows Off its Stuff at Canon Expo[^] doesn't bear thinking about! (Nor does it's price, I suspect)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: "runs" of identical data - binary data such as an image does not generally exhibit this, except in unusual circumstances. Draw a bitmap in paint, 300x300 pixels. Make all pixels black.
The problem is that someone is trying to compress data that is already compressed.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That's one of the unusual circumstances, yes!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Rıza Berkay Ayçelebi wrote: This algorithms are text based. What is your definition of "text based" ?
- As far as I know, Huffman and RLE can compress any kind of file.
- Rule of thumb: Nobody compress a compressed file because the compression algorithm become inefficient and the resulting file is bigger.
- I didn't check lately, but .bmp files were not compressed in early days of windows.
- RLE is efficient only with special kind of data that show very long runs of same values (like with fax).
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
modified 22-Nov-16 17:40pm.
|
|
|
|
|
Dear all
I create a method to play mp3 base on Text input. I create a playlist and import it to player. but the problem is that, the player plays only 3 files. (and i debugged and found that attributeCount always=3).
Please help for this case.
Below is my code:
private void PlayMP3()
{
try
{
string strLP = this.textBox1.Text.Trim();
string strPath = Application.StartupPath;
WMPLib.WindowsMediaPlayer player = new WMPLib.WindowsMediaPlayer();
WMPLib.IWMPPlaylist myplaylist = player.playlistCollection.newPlaylist("myplaylist");
myplaylist.clear();
foreach (char c in strLP)
{
string strFileName = "raw\\" + string.Concat(c, ".mp3");
string strFileLocation = Path.Combine(strPath, strFileName);
WMPLib.IWMPMedia media = player.newMedia(strFileLocation);
myplaylist.appendItem(media);
}
player.playlistCollection.importPlaylist(myplaylist);
player.currentPlaylist = myplaylist;
player.controls.play();
}
catch (Exception ex)
{
throw ex;
}
}
|
|
|
|
|
There can be many reasons for that, first one being that the player is initialized with only 3 tracks, or can run only three — i.e. filtered results. What is your playlist size? That controls how many tracks to play.
Using the Windows Media Player Control with Microsoft Visual Studio (Windows)[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Thanks Afzaal Ahmad Zeeshan!
my playlist size is more than 3 (often 10). and I user WMPLib. I'm trying to find out the problem but still not find!!!
|
|
|
|
|
Can you try and pass the songs, instead of passing the songs playlist to see if that works.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Are you using a trial version of a library with a hard (trial) limit? Seen this sort of behaviour before, along with only playing the first few seconds of a track
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I am using a hyperlink in a datagrid. When clicked I want to open the file with Process.Start:
private void DG_Hyperlink_Click(object sender, RoutedEventArgs e)
{
Hyperlink link = (Hyperlink)e.OriginalSource;
var fileName = link.NavigateUri.AbsolutePath;
fileName = fileName.Replace("file:///", "");
fileName = Uri.UnescapeDataString(fileName);
Process.Start("notepad.exe", fileName);
}
For local files this works fine. With network files the path is different:
/n/folder/folder/folder/thefile.txt
The file is on the N: share. The path is somehow formatted to start with 'n/'.
What's wrong here?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I'd start by looking at your original unmodified share path - if it is in the form /n/folder... or even file:///n/folder/... but it should be on the N: drive instead of the N folder of the current drive root then it's wrong: it doesn't specify a drive at all, and that probably needs looking at rather than "bodging around" to get it working.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Replace the : in the path with a pipe | :
file:
|
|
|
|