|
what does it mean by pixel's intensities in grayscale image?
|
|
|
|
|
The intensity of each pixel is variable. In color image systems, a color is typically represented by three or four component intensities such as red, green, and blue, or cyan, magenta, yellow, and black.
Black, white and gray pixels are also made of these components.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
|
For a simple game I'm developing I would like to play background music and sound effects.
I have tried a different methods to play two sounds at the same time with .NET SoundPlayer class, but with no result. At best, with use of .NET BackgroundWorker class, I could get the background music to play with no sound effect. Or only sound effects and no background music.
Anyway, I googled and searched for some solutions and found SDK library which I have implemented in my test application.
This is my test application:
* A Windows Form Application with two buttons
* Background music button, (btnBackgroundTrack_Click)
* Sound effect button, (btnEffectTrack_Click)
* The two music tracks are stored as UnmanagedMemoryStream type objects in a resource file
* "Resource.Background", the background music .wav-file, plays for 48 seconds
* "Resource.Item", the sound effect .wav-file, plays less than 1 second
This is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
using Microsoft.DirectX.DirectSound;
public partial class Form1 : Form
{
BackgroundWorker effectPlayer;
SoundPlayer effect;
public Form1()
{
InitializeComponent();
effectPlayer = new BackgroundWorker();
effectPlayer.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork);
effect = new SoundPlayer(Resource.Item);
}
void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
effect.PlaySync();
}
private void btnBackgroundTrack_Click(object sender, EventArgs e)
{
Device device = new Device(DSoundHelper.DefaultPlaybackDevice);
device.SetCooperativeLevel(this, CooperativeLevel.Normal);
SecondaryBuffer secondaryBuffer = new SecondaryBuffer(Resource.Background, device);
secondaryBuffer.Play(0, BufferPlayFlags.Default);
}
private void btnEffectTrack_Click(object sender, EventArgs e)
{
if(!effectPlayer.IsBusy)
effectPlayer.RunWorkerAsync();
}
}
This solution kinda works. The background music is played when I hit the "background" button, and if I hit the effect button it's plays as well.
Problem 1: If I click the effect button very fast and often while the background music is playing, all sounds from the program is termenated.
Problem 2: I would like the the background music to repeat it self when it's over.
Any solutions?
|
|
|
|
|
hey guys..i try to make a login panel and authorization..first i created a StoredProcedure like below
ALTER proc [dbo].[sp_KullaniciYetkiDegistir]
(
@KullaniciNo int,
@Yetki0 int,
@Yetki1 int,
@Yetki2 int,
@Yetki3 int,
@Yetki4 int
)
As
Begin
update Izin set ErisebilirMi = @Yetki0 where KullaniciNo = @KullaniciNo and YetkiNo = 1
update Izin set ErisebilirMi = @Yetki1 where KullaniciNo = @KullaniciNo and YetkiNo = 2
update Izin set ErisebilirMi = @Yetki2 where KullaniciNo = @KullaniciNo and YetkiNo = 3
update Izin set ErisebilirMi = @Yetki3 where KullaniciNo = @KullaniciNo and YetkiNo = 4
update Izin set ErisebilirMi = @Yetki4 where KullaniciNo = @KullaniciNo and YetkiNo = 5
End
in here i give some authority according to the KullaniciNo(here Erisebilirmi column is set as bit..so i can give or not give authority to the user)...and in my button's click i wrote like that
cmd = new SqlCommand("sp_KullaniciYetkiDegistir", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@KullaniciNo", System.Data.SqlDbType.Int).Value = KullaniciNo;
cmd.Parameters.AddWithValue("@Yetki0", System.Data.SqlDbType.Bit).Value = chkAdmin.Checked;
cmd.Parameters.AddWithValue("@Yetki1", System.Data.SqlDbType.Bit).Value = chkKullaniciEkle.Checked;
cmd.Parameters.AddWithValue("@Yetki2", System.Data.SqlDbType.Bit).Value = chkKullaniciSil.Checked;
cmd.Parameters.AddWithValue("@Yetki3", System.Data.SqlDbType.Bit).Value = chkYekilendir.Checked;
cmd.Parameters.AddWithValue("@Yetki4", System.Data.SqlDbType.Bit).Value = chkProjeGor.Checked;
if (cmd.ExecuteNonQuery() == 1)
MessageBox.Show("Authorities Are Set", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
MessageBox.Show("Authorization Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
here cmd.ExecuteNonQuery() drops directly Else block..what is wrong here??
any help will be appreciated
|
|
|
|
|
Your sproc updates a number of things, and that would cause ExecuteNonQuery to return an int larger than 1. How about assigning the result to a variable and displaying that, just to make sure?
I are Troll
|
|
|
|
|
thanks friend..i did what u said and i noticed that i made mistake in my if block..so it was working already but it is seen like it gives errror because of my wrong idea
thanks for help
|
|
|
|
|
You're welcome
|
|
|
|
|
Guys,
I hope this is the community , where people having experience in developing products, I am a Rookie coming slowly into Industry. I am developing a product for free ware on C#-Windows, I want some skins for better apperance, I googled a lot but no result, Please help me some skins for my UI, or some links. so that my UI looks rich...
Thanks in Advance
|
|
|
|
|
|
Hi,
try to check following link:
http://www.sunisoft.com/irisskin/
but unfortunately this components are not free. when you want to make you application much more "attractive" consider to migrate on WPF.
Regards
Robert
|
|
|
|
|
|
|
Write a macro, and start the macro from within the IDE
I are Troll
|
|
|
|
|
Hello,
how is it possible to check, that the client is connected, before i response to that? I have a lot time-intensive tasks, doing with HttpRequests and i don't want to work in my application and the client is disconnected.
Is there any way?
Thank you
|
|
|
|
|
No, because Http doesn't maintain a connection to the server. The connection is only around long enough to request the page and wait for the HTTP response to be returned. If you've got processing during the Response, then you can assume the client is still there. If you're doing the processing outside of the Response, there's no way to reliably determine if the client is still around from the server side.
|
|
|
|
|
Hello Experts,
I have an image which i want to print. it works successfully but it's qualtity is not fine.
So please suggest me how to improve the quality of image.
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(PrintImage, 0, 0, PrintImage.Width, PrintImage.Height);
}
Thanks
If you can think then I Can.
|
|
|
|
|
How does it differ from the original?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
My Image is in BMP Format.
If I am saving it's it is very fine and clear image. but after printing this it is not fine image.
If you can think then I Can.
|
|
|
|
|
That's because the image resolution on the monitor is much lower than decent print resolution.
|
|
|
|
|
Then How to manage it?
If you can think then I Can.
|
|
|
|
|
You need a copy of the image at a higher resolution - typically you'd be looking for a 300DPI image.
|
|
|
|
|
Dear Sir,
Actually my screen resolution is 96 and my Printer resolution is 600. So in that case my image is bluring.
So i want to know that how Can i get the best Print.
Thanks
If you can think then I Can.
|
|
|
|
|
Short of creating a 600DPI image from the 96 DPI version (it's going to be tough figuring out what the other 504 dots per inch actually are), you'd need 2 versions - the 96 DPI for the screen and the 600 DPI for the printer.
|
|
|
|
|
I want Fine Printing From MY Software. How can I Set the Printing DPI same as Screen.
If you can think then I Can.
|
|
|
|