|
There is no way to make it go faster, but you could load your images into an ImageList in Design mode, IIRC, and they will be compiled into your app as resources. You could then get all of your images into your PictureBoxes by fetching them from the ImageList.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks RageInTheMachine9532.
This works if i have a few images. But i have 3MB of gifs (in harddisk), so i load them in groups of about 14(about 45kb in harddisk - translates to 3MB in memory). Problem is that LoadPicture is slow here.
If i load them into an imagelist at design (all 3MB), they could chew 100MB of memory!
1fm1fu
|
|
|
|
|
Are you saying that the images you are using are small on disk (3MB total) but take up a LARGE amount of memory when loaded and rendered into a screen format bitmap (100MB)? If this is the case, no wonder it takes forever to load these. Without caching them in memory some how or expanding the images to a more native format (like .BMP), it looks like your going to have to put up with this problem.
I don't see how your going to get around this problem. You can't have speed and high compression at the same time. Generally, it's one or the other. This is because the LoadPicture function has to take a small amount of information and "draw" a large amount of graphics with it to create the bitmap image in memory.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have used the following codes to print out text in Portrait
<br />
Dim mFont As New Font("Courier New", 12)<br />
Dim xPos As Single = e.MarginBounds.Left<br />
Dim yPos As Single = e.MarginBounds.Top<br />
Dim lineHeight As Single = mFont.GetHeight(e.Graphics)<br />
Dim str As String<br />
<br />
'---------------------> Start to print <---------------------<br />
With e.Graphics<br />
str = "SALE SUMMARY From Date1 To Date2 ..............."<br />
.DrawString(str, mFont, Brushes.Black, xPos, yPos)<br />
..................................................<br />
.DrawString(str, mFont, Brushes.Black, xPos, yPos)<br />
..................................................<br />
End With<br />
- How can I set this to print in Landscape?
Thanks to all help
|
|
|
|
|
You might want to try setting the DefaultPageSettings on the PrintDocument object that gave you the Graphics object your using.
Dim myPrintDocumentObject As New PrintDocument()
myPrintDocumentObject.DefaultPageSettings.Landscape = True
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there,
Have an app that parses a .sql file, and executes on a connection object.
Have declared my conn object With Events, and am trapping various events so that I can log them.
When I run the following:
<br />
INSERT INTO Table VALUES (1,1)<br />
INSERT INTO Table VALUES (2,2)<br />
INSERT INTO Table VALUES (3,3)<br />
INSERT INTO Table VALUES (4,4)<br />
GO<br />
<br />
I am only getting my event handler triggered once, with RecordsAffected coming back as 1. What I need is for it either to tell me that 4 records have been affected, or hit the handler 4 times so that I can keep track myself, but there doesn't seem to be any way to do this - anyone know? Have tried trapping both the InfoMessage and ExecuteComplete events.
As an aside, when I do a DELETE FROM Table , am getting RecordsAffected back as 4, and am reading the file by LineInput & vbcrlf until I hit a GO, then conn.Execute strSQL
This is REALLY starting to annoy me!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Ain't gonna work like you want. The ExecuteComplete event will only get fired when SQL complete the BATCH of statements you sent it (remember the GO statement?), and will return the LAST record count affected, not all of them. You will either have to put up with this or send each command seperately, in your case, sending and executing each INSERT statement one at a time.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Feared as much....
Think that I'm going to have to write some sort of sql parser, and look in more detail at what is actually being sent to the server.
Thanks for the assistance!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
help!!!
any idea on how to read excel file in vb.net? an excel file must be in database definition format... then how to generate sql script basing from that file(excel).
help! any idea? it would be of great help... Thanx a lot!
|
|
|
|
|
in the Visual Studio IDE do a search for the term "Q257819." (sans the punctuation of course) This should show you a listing of topics, the first of which is "HOWTO: Use ADO with Excel Data from Visual Basic or VBA" This should lead you in the right direction.
|
|
|
|
|
thanx for your suggestion... i'll try it.
|
|
|
|
|
Hi
I am trying to complie windows application code written in VB.net from a command line.
I am getting errors as different classes involved in the project are referencing and using the members of each other, Thus creating a circular reference.
Now to complie 1 class in an assembly, I need other class already in an assembly for referencing. but oher class can not be complied seperately because it reference this class.
If anyone has a clue, Please help out.
Thanks & Regards
Dinesh
Learning more on Dot-Net
|
|
|
|
|
You haven't submitted any code, so we really can't tell you what your doing wrong. But, if I understand you correctly, how you are trying to do this might look something like this:?
Public Class A
Dim objB As New ClassB
End Class
Public Class B
Dim objA As New ClassA
End Class
IIRC, this is not going to compile because of the circular reference you are talking about. It's just bad object designed to have two classes completely dependent on each other. You're classes should be designed so that they are self contained modules and have a one way relationship:
Public ClassA
Dim objB As New ClassB
End Class
Public ClassB
' no code dependent on class A existing here...
End Class
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there,
when is suitable using a dictionary instead of an arraylist and wayback?
i mean, i can't retrieve an object from an arraylist using a string key, is it?
there are other difference/condition? i.e. array dimension or whatever?
thanks in advance!
fuel2run
|
|
|
|
|
If you want to use a String type key to retrieve data then you have to use a class that implements IDictionary , like a HashTable or SortedList . There are other classes, but those seem like they'll fit your needs. Anything that implements IDictionary is accessed by a key/value pair. You give it the key as a kind of index and the IDictionary will return the value associated with it.
ArrayList 's are accessed by an Index value, usually an Integer type.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I want to send a message to another computer by writing VB!!! Who can help me???
Thanks
tramdtt
|
|
|
|
|
There are a number of ways to send "messages" to other computers. Could you be more explicit in your request. Is the message aimed at a user, an existing process/application, another application you are writing, etc.?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi, Colin Angus Mackay
Thank for your answer. But can u say more clearly? I am writing a program which send and receive files using Winsock. But i want to send a message to received computer to notice whenever a file is sent to.
Which functions can I use to send message to received computer? I write in VB6,0.
Help me
Thank
tramdtt
|
|
|
|
|
Just use a socket and sent it a simple string saying it's done. There's exhaustive information about writing sockets on the net and in the MSDN.
|
|
|
|
|
When you send the message, is there going to be a client app on the detination computer that will recieve this message? If not, you'll need one!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I use Winsock to write a app send and receive files throughout computers on LAN. I used to use SendData method to send a string to app of destination computer . But I want to send a message to notice to destination computer whenever files are delivered to destination computer.
Which functions Can I use in this situation?
Help me!
Thanks
tramdtt
|
|
|
|
|
I have a global system hook, using "dscwpmsg.dll" and an example from www.allapi.net (acording to the read me: a system wide Hook of the types "WH_CALLWNDPROC" and/or "WH_GETMESSAGE").
I want to know when the a user RIGHT clicks on the minimize (or any other) button of the control box (top right of every window).
If any one has any ideas I'd appriciate it. And before any one sais you can't (people on IRC caim it is not possible): it is possible, I have an application that does it, now I want to know how...
|
|
|
|
|
Hello..I'm new in VB.net
I have form with display button and text box.
I have myclass.
<br />
Namespace theClass<br />
<br />
<br />
' The class is named StringProcessor.<br />
Public Class myClass<br />
<br />
Public Sub printOut(ByVal t as String)<br />
<br />
MsgBox(t)<br />
End Sub<br />
End Class<br />
End Namespace<br />
Then I want to print out what the use type in so I call
printOut(Me.InputText.Text)
but I got error message like
An unhandled exception of type 'System.NullReferenceException' occurred in BrianHuang_Unit5.exe
Additional information: Object reference not set to an instance of an object.
help me how to correct it please.
|
|
|
|
|
You don't give the stack trace of the error message, so it is harder to tell WHERE it happened.
Given the code snippet you've supplied Me.InputText is the most likely culprit, if so that means you have not set it to an instance of an object. You need to instantiate Me.InputText first.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|