|
I guess you're right - problem is my little crop app is part of a bigger app where I have quite a few tabs and dialogs where I want to use the same Image object so I was hoping to convert the final graphics object back into an Image for that reason. Guess I'll just have to either save it to a temp file and load it back in (not efficient!) or just change my whole app to use a graphics object rather than an Image... bit of a nuisance though.
The thing is that you can create a Bitmap or Graphics object from an Image object but you don't seem to be able to go the other way... that's what I really wanted to know.
Cheers,
Mike
|
|
|
|
|
You can't use a Graphics object instead of an image. A graphics object doesn't have any canvas of it's own, it just draws on other stuff, like a Bitmap object or the screen. When you create a graphics object for an image, you don't convert the image into a graphics object, you just set the graphics up for drawing on the image. As the graphics object doesn't hold any image data itself, it can't be converted into an image.
There is no problem in sharing the same image object between several controls. You only have to invalidate all the controls that use the image for any changes in the image to show up in the controls.
---
b { font-weight: normal; }
|
|
|
|
|
Hey
I have tryed to get date(Monday) by a week nr and year but this do not always work.
Here is my code
<br />
Public Function getDateByWeekNr(ByVal inWeekNr As Integer, ByVal inYear As Integer) As DateTime<br />
Dim cal As New System.Globalization.GregorianCalendar<br />
Dim dTime As DateTime<br />
<br />
dTime = New DateTime(inYear, 1, 1)<br />
<br />
For i As Integer = 0 To 365<br />
If dTime.DayOfWeek = DayOfWeek.Monday Then<br />
Exit For<br />
Else<br />
dTime = dTime.Subtract(New TimeSpan(24, 0, 0))<br />
End If<br />
Next<br />
<br />
Return cal.AddWeeks(dTime, inWeekNr)<br />
End Function<br />
what am i doing wrong?
|
|
|
|
|
You could use something like this
[CODE]
Dim dTime As DateTime
dTime = New DateTime(2006, 1, 1)
Dim wkCtr As Integer
Dim inWk As Integer
While 1
If dTime.DayOfWeek = DayOfWeek.Monday Then
wkCtr += 1
End If
If dTime.DayOfWeek = DayOfWeek.Monday And wkCtr = inWk Then
Exit While
End If
dTime = dTime.AddDays(1)
End While
[/CODE]
|
|
|
|
|
Thanks, i will tray that, is this working even if the1 week of a year started last year?
|
|
|
|
|
Thanks, i will try that, is this working even if the1 week of a year started last year?
|
|
|
|
|
Thanks, i will try that, is this working even if the week of a year started last year?
|
|
|
|
|
Glad to help you. This will give you the Nth Monday of an year.
|
|
|
|
|
Is it possible to determine user's logon time using vb scripts
|
|
|
|
|
|
Hi, thanks for the reply,i need to determine the time users log on to the domain in an active directory environment.
"Set objUser = GetObject("LDAP://CN=******)
Set objLastLogon = objUser.Get("lastLogonTimestamp")
intLastLogonTime = objLastLogon.HighPart * (2^32) + objLastLogon.LowPart
intLastLogonTime = intLastLogonTime / (60 * 10000000)
intLastLogonTime = intLastLogonTime / 1440
Wscript.Echo "Last logon time: " & intLastLogonTime + #1/1/1601# "
I got this on the microsoft website but it hasn't worked.
|
|
|
|
|
Well, the lastLogonTimestamp property is not replicated between domain controllers very often, measured in days, depending on policy settings! So, each domain controller can have a different value for the same user!!
There is no event the says this value changed either so you'll have to poll each and every user object on each and every domain controller to get an accurate time for each user. This is VERY resource intensive on both the network and the domain controllers. If you do this in a production environment, you have to be VERY careful about how often you poll for this information.
Also, there is a known problem with the lastLogonTimestamp and NTLM authentications... http://support.microsoft.com/default.aspx?scid=kb;en-us;886705[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi there,
I am creating a text file in VB.Net and I am writing arabic characters inside, but my problem is that when I read this text file using vb6 on other machine I read wrong characters , does anybody know why
thanks alot
|
|
|
|
|
they machines doen't have ur arabic font.
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
You have to write the file using the same encoding as the VB6 program will use to read it. Probably UTF8.
---
b { font-weight: normal; }
|
|
|
|
|
hi
thanks for the rply but I am using writexml function and it doesn't have encoding options, so what shall I do
thanks
|
|
|
|
|
Yes, write methods doesn't have any encoding options. You decide the encoding when you open the file.
---
b { font-weight: normal; }
|
|
|
|
|
hi i have database in access and i have problem of convert some fileds to one filed i konw it can be done with VB but i am not sure if it can be done sql
for example if i have culomn with 1,2,3,4,5 so to converted and but it in one filed 1|2|3|4|5
if any body knows what i have to do to make it right
please send me you help and i will be greatfull
|
|
|
|
|
Hi,
Plz specify wat u want to do with ur database.
Do u want to merge multiple fields of ur access database into a single field?
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
-- modified at 4:57 Monday 27th March, 2006
|
|
|
|
|
hi first thinks for your fast reply
exactly that what i want
for example culomn and each filed has number so i need Function to merge this fileds in one filed
thanks again
|
|
|
|
|
How can i save possition of the form to an file like a text then when the form loads that it loads on saved possition!?!?!?
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
Please answer quick...
<blink>FeRtoll Software.net
------------
E-Mail me
WebPage
|
|
|
|
|
FeRtoll wrote: Please answer quick...
You do relize that, in a forum environment where the people who answer questions DO NOT GET PAID TO DO SO, this means "Please, graciously ignore my post!"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Have you looks at your forms' Top, Left, Width, and Height properties? All you ahve to do is save those values to a file or to a registry key. You might want to look into the SaveSetting[^] function for a simple implementation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|