|
Wouldn't ExitWindowsEx P/Invoke API help you out?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hello every one,
I am making a application similar to paint brush...
Hear i am finding one issue that pen width '1' is too small and '2' is really big...
is there any way i can have width between 1 and 2?
regards
Nishkarsh
|
|
|
|
|
Hi,
Pen width takes a floating-point number (a Single in your language). Did you ever consider
and try something like 1.5?
|
|
|
|
|
It is taken as a single in VB.net.
I tried 1.5 and all... it did not threw any error but the size also did not changed..
|
|
|
|
|
You could try setting the Smoothing Mode of your graphics object to be of an antialiased:
g.SmoothingMode = SmoothingMode.HighQuality
That will deal with 1/2 pixels well, but is a bit slower.
|
|
|
|
|
you may not notice a difference between 1 and 1.5 when drawing a horizontal or vertical line,
after all the pixels of your screeb are discrete, so it will hit either one row of them, or two.
Things should be different though for slanted lines, circles, etc,
|
|
|
|
|
Thanks a lot to both of you..
Inputs from each one of u had resolved one part of my issue
|
|
|
|
|
Hi Luc
i think i will need a bit more clarity on pen width..
there is for sure some difference between size 1.6 and 2.0 . But there is a huge difference between 1.5 and 1.6 (i am using huge in relative terms only.. )...
This is making the line width uneven in the application...
is there some thing more i need to look at or i am missing out???
Regards
Nishkarsh
|
|
|
|
|
Hi,
I can't help you with detailed information, I haven't done much with pen width yet.
I would look for some properties on either Pen or Graphics that relate to drawing quality,
such as the smoothing thing Jasey9 mentioned. To name a few more: Pen.StartCap, EndCap, LineJoin,
MiterLimit; and Graphics.InterpollationMode, PixelOffsetMode.
You may discover computer graphics is a complex subject...
|
|
|
|
|
hi all,
i want to know the size of particular string for specified font . i use following code
Dim g As Drawing.Graphics <br />
Dim size1 As SizeF<br />
size1 = g.MeasureString(string1, Font1)
in above code, last statement give error . i know there are little error. Can any body told me that how can i correct above statement ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Rupesh Kumar Swami wrote: in above code, last statement give error
What is the error it gives?
|
|
|
|
|
Hi,
read the little error message and apply a little code correction accordingly.
I hope you did initialize your Graphics object "g", your string "string1" and your Font "Font1".
How do you want us to help you if you don't provide details on the symptoms?
|
|
|
|
|
hi,
i read the error message, which give "NullReferneceException" . I does not use New keyword for graphics object.(or not initialize the object g).i have no idea for this thing. So how can i initialize the object g for measure string size ?
in code snippet(in previous post) string 1 and font1 contains related value.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Try something like:
using bmp as new bitmap(1,1)
using g as graphics=graphics.fromimage(bmp)
[Measure string here using g]
end using
end using
But you will be better off using the correct graphics canvas to use - if you are drawing text to an image, use that image instead of creating a new one like the above example.
|
|
|
|
|
Thanks jasey. Its work for me
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
if you don't assign anything to the reference "g", how do you expect it to do anything for you?
you NEED a Graphics, so get one.
Here are some popular ways:
- inside a Paint handler, use g=PaintEventArgs.Graphics
- if drawing to an Image, use Image.CreateGraphics (warning: expensive operation, make sure
you call dispose afterwards, and don't do this all the time).
|
|
|
|
|
Please i have a working vb.net email application but anytime i have to send emails across a proxy server, it doesnt work
Please any one wana help me?
phatkin
|
|
|
|
|
The .NET Framework SMTP classes currently do not support proxy connections.
|
|
|
|
|
Hi,
I know there's a load of articles about how to avoid the problem of "too many connections" and I have tried searching many of the forums and articles about the topic.
Is there a way to find out how many open connections to an Access mdb using VB.Net 2005.
My program has been used for a long time without any issues, but recently I bought a new PC (with dual core quad processor) and the "too many connections" problem is reappearing.
How is the best way to find out how many connections are open at any point in time.
Thanks for your help.
|
|
|
|
|
Not sure but you should try getting your connections from a pool instead. This is better practice.
|
|
|
|
|
I think you may be running up against the fact that Access is designed as a single user database and should not serve as a neworked DB. Having said that I used one for years with 8 users regularly hanging off it.
Also if you are directly connecting your forms to the database you may be creating a heap of uncontrolled connections. Are you using a DAL. If so use connection pooling.
I would consider the use of Access a fundamental shortcoming, look into converting to SQL Express/Server. This will give you all the control you need and it is a real database. The upgrade/transfer used to be painless (1998).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Thank you for your feedback. I am painfully aware of Access shortcomings.
Actually what would be great if someone could advise how to determine the number of open connections at any point in time - is there such a way to find this out?
Thanks in advance for any help.
|
|
|
|
|
maper1 wrote: how to determine the number of open connections at any point in time - is there such a way to find this out?
Since Access is a file-based database, with each client maintaining their own connection information, there is no central control of connections to the database. Because of this, there is no way to determine how many open connections to the database there are.
|
|
|
|
|
Easy question for someone.
Where do I get the control for MAPI
I have VB.Net 2005
|
|
|
|
|
.NET does not have MAPI controls . I used MAPI controls from VB6
'add 2 controls
Microsoft MAPIMessages (call it MAPIMessages1)
Microsoft MAPISession (call it MAPILogOn)
(AxInterop.MSMAPI.dll, Interop.MSMAPI.dll)
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim msg As String
msg = "This is a test email from Iouri."
With Me
.MAPILogOn.SignOn() ' use current user
Do While .MAPILogOn.SessionID = 0
System.Windows.Forms.Application.DoEvents() ' need to wait until the new session is created
Loop
Call SendToEmail("someone@somewhere.com", msg)
.MAPILogOn.SignOff()
End With
MsgBox("e-mail is sent")
End Sub
Private Sub SendToEmail(ByVal Email As String, ByVal msg As String)
With MAPIMessages1
'create a new message and address it
.SessionID = MAPILogOn.SessionID
.Compose()
.RecipDisplayName = Email
.AddressResolveUI = True
.RecipAddress = "smtp:" & Email
.MsgSubject = "VB GENERATED E-MAIL"
.MsgNoteText =msg
.Send(False)
End With
End Sub
End Class
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|