I created in my project a User Control: Right click on project name > Add > User Control.
Then in the User Control designer i added some controls. And in the User Control constructor i did:
public DopplerEffect()
{
InitializeComponent();
InitGifFile = @"C:\Users\me\AppData\Local\mws\mws\temp_directory\file000050.gif";
pen = new Pen(Color.Red, 3);
formloadfirsttime = true;
numericUpDown1.Value = 200;
brush = new SolidBrush(Color.Red);
trackBar2.Minimum = 1;
trackBar2.Enabled = false;
bmpnew = new Bitmap(512, 512);
label1.Text = "";
path_exe = Path.GetDirectoryName(Application.LocalUserAppDataPath);
ScanClouds = Path.Combine(path_exe, ScanClouds);
if (!Directory.Exists(ScanClouds))
{
Directory.CreateDirectory(ScanClouds);
}
ConvertedBmpDir = Path.Combine(ScanClouds, ConvertedBmpDir);
if (!Directory.Exists(ConvertedBmpDir))
{
Directory.CreateDirectory(ConvertedBmpDir);
}
b = new Bitmap(InitGifFile);
b1 = new Bitmap(InitGifFile);
pictureBox1.Image = b;
ConvertedBmp = ConvertTo24(InitGifFile);
mymem = ToStream(ConvertedBmp, ImageFormat.Bmp);
startButton.Enabled = true;
pauseButton.Enabled = false;
}
For now i'm using a static directory for a gif file:
The problem is when i'm dragging the User Control to form1 designer it will work on the file: file000050.gif
But i want it to use a file i have in form1 somewhere in my form1 code i have a string file called: next_file
So when i'm dragging the User Control in the form1 designer i need it somehow to get automatic the next_file so InitGifFile instead be file000050.gif should be next_file
How can i do it ?
Aucun commentaire:
Enregistrer un commentaire