|
Hi
I'm new to Visual C++ and .NET Framework; I'm trying to display a bitmap image on a Windows Form in Visual Studio 2005 but am experiencing problems with this.
I have examples for VS 2003 but these don’t seem to work in VS 2005.
Does anyone have any examples of displaying a bitmap in VS 2005?
Any help appreciated
|
|
|
|
|
Hi, if you are serious about this, then please get your act together:
1.
rover_boy wrote: these don’t seem to work
that's no information; are there compile errors? solve them. are there run-time errors,
exceptions? what are they, solve them. Do you need help, ask specific questions on
the appropriate forum (or at the bottom of the CodeProject article itself).
2.
rover_boy wrote: Does anyone have any examples
there are thousands of articles, a lot of them very good, here on Code Project.
Wouldn't a lot of them show images?
3.
The best way to learn a new technology is the systematic way: buy a book, work your
way through it, experiment, and look around. After a year, read the book again, and
buy another one.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
i am new to .net 3.0. i have worked in .net 2.0. what needs to be installed for .net 3.0?
and give me software links.
|
|
|
|
|
sreenivasaraok wrote: i am new to .net 3.0. i have worked in .net 2.0. what needs to be installed for .net 3.0?
My first guess would be .Net 3.0...
sreenivasaraok wrote: and give me software links.
Here ya go. http://www.paddedwall.org/help[^]
-- modified at 7:36 Monday 12th November, 2007
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Why do you put this bad link http://www.paddedwall.org/help ??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
It's a valid link.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Here ya go. http://www.paddedwall.org/help
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
|
Well...that will install .NET 3.5 not 3.0, although that will get you all the bits in 3.0.
|
|
|
|
|
VS 2008 has .NET 2.0, .NET 3.0 and .NET 3.5
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Is it possible to convert a C++ application (written using VS2005) into C#?
|
|
|
|
|
Yes.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
1) Draw a 6-foot circle with white chalk on a red-brick floor.
2) Place an unbroken raw egg in the exact center of the circle.
3) Leave the room for exactly 12 seconds.
4) Re-enter the room.
5) Observe the egg.
6) Something magic happens.
7) SHA-ZAMM! Your C++code will be converted to C#.
There's no magic bullet and no handy utilities to help you. You're actually going to have to be a real programmer and do it by hand.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: You're actually going to have to be a real programmer and do it by hand
For some reason, an anatomically inappropriate gesture occurred to me here.;)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O'Hanlon wrote: an anatomically inappropriate gesture occurred to me here
That's sick.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Paul Conrad wrote: That's sick.
That's me.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Fayu wrote: How?
Take your Object Oriented Design documents ( you know, the ones you created from Analysis of your Requirements and Business Model documentation) and implement the Design in C#. Of course this assumes working knowledge of the .NET platform and the C# language, if you need that first then you might want to start there and then come back to your Design documents.
|
|
|
|
|
No, that's what we like to call a 'rewrite'
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I need to access a website and download several hundred spreadsheet files. The problem is that I must use POST to initiate the download. I cannot use webclient.downloadfile becuase I dont have a url to pass.
I am able to get the download started using a bit of test code I wrote. Now I just need to handle the file download dialog that saves the file. If possible I would like to bypass the download dialog and complete the process in code.
The following test code actually works (in its complete form) to get the download started:
object missing = "";
InternetExplorerClass ie = new SHDocVw.InternetExplorerClass();
ie.Navigate("http://alfred.stlouisfed.org/series/downloaddata?seid=RSAFS&cid=6", ref missing, ref missing, ref missing, ref missing);
System.Threading.Thread.Sleep(5000);
mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)ie.Document;
foreach (mshtml.IHTMLElement pageElement in doc.all)
{
// click some elements
}
Is it possible to get the url that will be sent back to the server from the document AFTER I "click" the parameters?
I have already seen The most complete C# Webbrowser control which is posted here on CodeProject. Either it is not designed to do what I described above or I dont understand it well enough to put it to good use. If there is some code there that illustrates what I am asking, kindly point me in the right direction. Thanks anyone for some help with this. I have searched every corner of the internet for an answer and I am truly stumped.
|
|
|
|
|
Why not use FTP? It's better suited to this type of operation. A simple example would look like this:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace FtpLibrary
{
public class FtpClass
{
#region Members
private string _ipAddress;
private string _userId;
private string _password;
private int _bufferSize;
#endregion
public FtpClass(string ipAddress, string userId, string password)
: this(ipAddress, userId, password, 4096)
{
}
public FtpClass(string ipAddress, string userId, string password, int bufferSize)
{
_ipAddress = ipAddress;
_userId = userId;
_password = password;
if (bufferSize < 1024 || bufferSize > 8192)
_bufferSize = 4096;
_bufferSize = bufferSize;
}
public void Download(string filePath, string fileName)
{
FtpWebRequest ftpRequest;
try
{
string path = Path.Combine(filePath, fileName);
string uri = string.Format("ftp://{0}/{1}", _ipAddress, fileName);
using (FileStream outputStream = new FileStream(path, FileMode.Create))
{
ftpRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
ftpRequest.Method = WebRequestMethods.Ftp.DownloadFile;
ftpRequest.UseBinary = true;
ftpRequest.Credentials = new NetworkCredential(_userId, _password);
FtpWebResponse response = (FtpWebResponse)ftpRequest.GetResponse();
Stream ftpStream = response.GetResponseStream();
long cl = response.ContentLength;
int bufferSize = _bufferSize;
int readCount;
byte[] buffer = new byte[bufferSize];
readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
outputStream.Write(buffer, 0, readCount);
readCount = ftpStream.Read(buffer, 0, bufferSize);
}
ftpStream.Close();
outputStream.Close();
response.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete I would love to use ftp it would solve so many problems. The question I asked really has nothing to do with ftp. Why is the code you posted relevant?
Thanks
|
|
|
|
|
If you don't want to use FTP, then ignore the code; but I put it there to show you how easy it is to use FTP, and to question why you would want to do something other than use FTP to do a task which FTP was designed for. I really can't see why you would want to do anything else here.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete,
I appreciate the fact that you have taken the time to respond to my question. If you take a brief moment to read the post you responded to you would note that I am trying to download files from the website of Federal Reserve Bank of St. Louis. While they are a great bunch of folks, I highly doubt that they would put up an ftp server for no other reason than to resolve my little issue .
If you feel the code is useful, please post a specific example of how it might be used in the context I described.
I am open to resolutions of any kind. I have done a fairly extensive search and no one seems to have a solution.
|
|
|
|