|
I need a way to blit, as it were, several pictures off screen and then show them as a single image on screen.
Using GDI+ or a picture box displays the images one at a time until all are displayed, but it is very slow over a network.
Is it even possible?
Thanks
|
|
|
|
|
Not sure what you mean...
What do you mean by slow network? Please try to explain your problem more detailed and also what youve tried so far.
|
|
|
|
|
Maybe an example would help here.
...
Graphics g = e.Graphics;
string[] files = Directory.GetFiles("path", "*.gif");
foreach(string file in files)
{
g.DrawImage(Image.FromFile(file), x, y, width, height);
(the x, y, width, and height variables are adjusted for each
image, so they don't draw on top of each other)
}
...
This is placed in the OnPaint method of the form. If the graphics are placed on the harddrive of the machine running it, the art appears rather quickly. But if the art is stored on a server, or on a CD, each image is shown one at a time (quite a bit slower than storing the pics on the local machine), until all images are shown.
I need a way to draw the images onto an object off screen (perhaps a Bitmap object?) and then when all of the images have finished drawing, display the finished object as a single piece of art.
I have seen examples of this using DirectDraw, but I want to do this without DirectX.
Thanks for your help.
|
|
|
|
|
Ok now I got it.
Create a bimtap which is big enough to hold all your images, get a Graphics object from it, then draw all your images into that graphics and finally draw it onto your Graphics object:
<br />
Bitmap b = new Bitmap(totalWidth, totalHeight);<br />
using (Graphics g = Graphics.FromImage(b)) {<br />
string[] files = Directory.GetFiles("path", "*.gif");<br />
foreach(string file in files)<br />
{<br />
g.DrawImage(Image.FromFile(file), x, y, width, height);<br />
}<br />
}<br />
e.Graphics.DrawImageUnscaled(0, 0);<br />
But note that the total amount of time spent for this operation will not be shorter, because neverthless reading from CD or over network will consume some time. But if needed you could cache the whole bitmap to make the next drawing faster.
|
|
|
|
|
Thank you, I will give this a try.
|
|
|
|
|
Thank you, that is exactly what I needed.
I did not expect the build time to be any different, I just didn't want to watch each of the images build on the screen.
Thanks again.
|
|
|
|
|
hi
how i can assign ENTER to a button in a web page?
( pressing ENTER : fire the button_click events )
thanks
|
|
|
|
|
|
for thisfunctionality u need to have the button to be the default button..for this set button's tabindex property to 0(zero) and see to it that no other control has its tabindex property set to "0".And if needed set the other controls tabindex property as need for navigating in taborder.
|
|
|
|
|
is there any way to do the same in windows forms ?
|
|
|
|
|
hello this is a stupid question but whats the easiest way to determine if a string contains a certain sub string?
|
|
|
|
|
IndexOf returns -1 if it's not there. Or a RegEx if you need case insensitive checking.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
One way is to use the IndexOf function
|
|
|
|
|
I am trying to write an application that allows user login by windows authentication (includes domain and username).
For example:
Username: MYDOMAIN\MyUser
Domain:MYDOMAIN
If this username is valid, application will check for user's role, if user's role is BUILTIN\Users then this user can do their works.
But it's so difficult, can you help me?
|
|
|
|
|
This[^] previous thread has a similar question, refer to it for possible answers.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Im trying to call a function in a class written in managed c++, from c#. The compiler interpret the types WCHAR*, BSTR and wchar_t* in managed c++ to a ushort* in c#.
This is the C# code calling the method _logonUserWithSSPI in the managed c++ code:
pExistingTokenHandle = oSSPIHelper._logonUserWithSSPI(NTLM", TOKEN_QUERY, "DOMAIN", "test", "smurf");
This is the managed c++ code (.h):
HANDLE _logonUserWithSSPI(WCHAR* pszSSP, DWORD grfDesiredAccessToToken, BSTR pszAuthority, wchar_t* szPrincipal, wchar_t* pszPassword);
How could I call this _logonUserWithSSPI method and pass the strings to it (convert a string to ushort*)?
|
|
|
|
|
I've a dll that hold a DataSet I need this DataSet to be Reference to a DataSet In My project....
as We do In C++ with pointers.......
plz help
|
|
|
|
|
hi,
Im developing a music centre project for college and i was just wondering could someone clear this up for me before i delve into it further.
Is it possible to rip straight from a CD to .mp3 or .ogg using C#? These are the only two format options i am allowed to use.
I have done a lot of searching and i am surprised that i couldnt find any decent information on it. I have found lots of shareware applications that do so i have to assume that it can be done, its just that no one wants to tell anyone how they didit!
At the minute im thinking off just ripping them as .wav's and then automatically converting them to .mp3 and then deleting the original .wav.
Yes this does sound crap and would take a lot of time in the application, AND i would get an awful grade for it but at the minute its all i can think off!
Any help appreciated!
J.
|
|
|
|
|
Find the specification for a music cd, and then a mp3. Then with your C# skills do the conversion from the cd audio to mp3 format.
/\ |_ E X E GG
|
|
|
|
|
|
hello worlde
can you helpe me for control comera white c#
tankyou
|
|
|
|
|
Based on this detailed information, no. What camera ? How do you want to 'control' it ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hello worlde
can you helpe me to control camera whitt c#
tankyou
|
|
|
|
|
Please help me! How can I intergrate my project into .NET template (a wizard-like project). I have read some articles, but I was confused !
Can you please show me step by step!
Thank you very much!
|
|
|
|
|
I have a stupid question:
May I include a file of any type into my project for further using?
For example, I include a text file into my project (Readme.txt), then I can read this file internally from my project by my form
|
|
|
|