|
It is kind of a requirement.I need to zoom a big image smoothly.It can be achieved only when scaling time in about 70 milliseconds or less. I might ask the question inappropriately.I do not need the whole picture be zoomed,only the part which is visible.But i have had a try with the GDI+,it taked about 1500-3000 milliseconds to zoom the whole picture and 200-300 millseconds to the visible part(it's size is about 1300 * 960).There is another problem. If every time in pan conducting a zooming operation so pan operation will become dull.My current solution is keeping the zoomed image in memory and drawing it to the screen when a pan is requested.But it takes a lot of memory.
If there is a syntax error, please forgive me, because I am using Google Translate.I am chinese and English makes me a headache.
Thank you for your answer.
谢谢!来自中国的感谢。哈哈!
|
|
|
|
|
991176515 wrote: I need to zoom a big image smoothly.It can be achieved only when scaling time in about 70 milliseconds or less. One cannot guarantee execution-time under Windows, due to the way multitasking is implemented. Giving the impression of a smooth transition is a lot easier. In a game, one might abuse the graphics card to blur one image into another.
991176515 wrote: But i have had a try with the GDI+,it taked about 1500-3000 milliseconds to zoom the whole picture and 200-300 millseconds to the visible part(it's size is about 1300 * 960). Imagine you use a second copy of that picture, but scaled to 120 * 96. It'd zoom real fast, but it'd be looking "blocky" due to the resolution. Show that while zooming on the high-res version of your picture on a background-thread. Replace when ready, or abort if the user zooms out or pans.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
A different concept could bring the solution. Do you know Google Earth? They send "tiles", each tile consists of 256*256 pixels. And those tiles are then drawn on the screen, each at its place.
So you could split the big image into several tiles, and do the zoom and draw operations only on the tiles required currently.
|
|
|
|
|
Hi all I keep getting the system null reference exception
I know where it is I just wonder why there is a null.
Public Class Countries
Const ARRAY_UPPERBOUND As Integer = 8
Public Structure WorldCountries
Dim countriesNames As String
Dim countriesAbbreviations As Integer
End Structure
Dim enterCountry(ARRAY_UPPERBOUND) As WorldCountries
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub Countries_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim enterCountry(ARRAY_UPPERBOUND) As WorldCountries
enterCountry(0).countriesNames = "Antarctica"
enterCountry(0).countriesAbbreviations = "AQ"
enterCountry(1).countriesNames = "Bahamas"
enterCountry(1).countriesAbbreviations = "BS"
enterCountry(2).countriesNames = "Canada"
enterCountry(2).countriesAbbreviations = "CA"
enterCountry(3).countriesNames = "Estonia"
enterCountry(3).countriesAbbreviations = "EE"
enterCountry(4).countriesNames = "France"
enterCountry(4).countriesAbbreviations = "FR"
enterCountry(5).countriesNames = "Ireland"
enterCountry(5).countriesAbbreviations = "IE"
enterCountry(6).countriesNames = "Japan"
enterCountry(6).countriesAbbreviations = "JP"
enterCountry(7).countriesNames = "Mexico"
enterCountry(7).countriesAbbreviations = "MX"
enterCountry(8).countriesNames = "Netherlands"
enterCountry(8).countriesAbbreviations = "NL"
End Sub
Private Sub CountryAbbreviationButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CountryAbbreviationButton.Click
Dim cNames As String
Dim bfound As Boolean = False
'get input
cNames = CountryTextBox.Text.ToLower
'Compare input
For l As Integer = 0 To ARRAY_UPPERBOUND
If cNames = enterCountry(l).countriesNames.ToLower Then
bfound = True
AbbreviationTextBox.Text = enterCountry(l).countriesAbbreviations
Exit For
End If
Next
'If Found
If Not bfound Then
MessageBox.Show("Name not Found")
End If
End Sub
End Class
|
|
|
|
|
Member 10409199 wrote: Public Class Countries
Dim enterCountry(ARRAY_UPPERBOUND) As WorldCountries
Private Sub Countries_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim enterCountry(ARRAY_UPPERBOUND) As WorldCountries
...
You have declared a local variable within your Countries_Load method with the same name as the field. You initialize the items in the local variable, and then throw it away. The field is never initialized. When you then try to read from the field in the CountryAbbreviationButton_Click method, the values have not been initialized, and you get a NullReferenceException .
To fix the problem, remove the local variable declaration from your Countries_Load method.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hi I have developed a vbs file which will execute some commands in command prompt and store its output in a text file in same directory where script is run. Now i have converted this vbs file to exe using iexpress wizard by windows. but when i execute the its run in TEMP folder and does not create any text file out . is there any workaround for it to behave same as vbs file when the exe is run.
|
|
|
|
|
On page 21 of IExpress Configuration Wizard[^], it shows a command line switch /t:path that can be used to specify the target folder for extracted files.
|
|
|
|
|
Oh my! Someone read the documentation?! This will never catch on.
|
|
|
|
|
Deserves the up vote just for that. RTFM is an acronym I avoid - they may want me to write the dammed thing first!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks but where i can use this switch
|
|
|
|
|
On the CommandLine when you execute the self-extracting package generated by IEXPRESS.
|
|
|
|
|
I'm getting an error that says:
nullreferenceexception was unhandled by user code
This is my Code:
Protected Sub GrdSorter(ByVal sender As Object, ByVal e As GridViewSortEventArgs)
Dim dt As DataTable = TryCast(ViewState("grdNurseVisits"), DataTable)
Dim dvGridDataView As DataView = dt.DefaultView
Dim strSortOrder As String = ""
If ViewState("SortOrder") Is Nothing Then
ViewState("SortOrder") = "asc"
End If
If ViewState("SortOrder").ToString() = "asc" Then
ViewState("SortOrder") = "desc"
strSortOrder = "desc"
ElseIf ViewState("SortOrder").ToString() = "desc" Then
ViewState("SortOrder") = "asc"
strSortOrder = "asc"
End If
dvGridDataView.Sort = Convert.ToString(e.SortExpression) & " " & strSortOrder
dt = dvGridDataView.ToTable()
grdNurseVisits.DataSource = dt
grdNurseVisits.DataBind()
End Sub
I got the code from this site and there is step I didn't put in because I don't know the correct code.
this is the step:
Populate the ViewState with the datasource of the gridview in the If Not Page.IsPostBack
I don't know how to write that step in vb code
Could some one please let me know how to get this code to work...
|
|
|
|
|
Go to the place where you got the code and ask there.
Veni, vidi, abiit domum
|
|
|
|
|
|
Member 10386526 wrote: Thanks for nothing Think about your issue: you have downloaded some code from somewhere on the internet, without giving us any idea where it came from. There is a part that requires additional code which you expect us to understand, even though we have no idea what the code is based on. You have not explained which line the error occurred on, but you expect us to figure out why it doesn't work.
Veni, vidi, abiit domum
|
|
|
|
|
You have been on the site for a week, 7 days, and post a section of code saying you have an error, but don't know how to solve it.
Someone suggests you go to where you got the code from and ask there.
Assuming your 'this site' means CodeProject, then, was the code part of an article or what?
Did you ask the author of the code for help?
Member 10386526 wrote:
Thanks for nothing
Not a good way to start a relationship... we are VOLUNTEERS, not PAID STAFF.
|
|
|
|
|
I have a excel file that requires that data from a cell to be sent to another program. Instead of manually copying and pasting, is it possible to use VB to "tab" to an open window in another program (window is always named: "Message - New"), and to paste the data into.
Thanks!
Roy
|
|
|
|
|
|
Here is a simplified VBA example that may be of help to you. The big issue is getting a handle to the window into which you want to paste.
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowByCaption Lib "user32" _
Alias "FindWindowA" _
(ByVal thismustbezero As Long, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" _
(ByVal parentHandle As Long, _
ByVal childAfter As Long, _
ByVal lclassName As String, _
ByVal windowTitle As String) As Long
Private Declare Function SendMessage Lib "user32.dll" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Private Const WM_Paste As Long = &H302
Sub Test()
Dim res As Double
res = Shell("notepad.exe", vbNormalFocus)
Dim hWndNotepad As Long
hWndNotepad = FindWindowByCaption(0, "Untitled - Notepad")
Dim hwndEdit As Long
hwndEdit = FindWindowEx(hWndNotepad, 0, "Edit", "")
Range("Sheet1!A1").Formula = "This was copied from my excel spreadsheet"
Range("Sheet1!A1").Copy
Dim res2 As Long
res2 = SendMessage(hwndEdit, WM_Paste, 0, 0)
End Sub The Spy++ program included in the full version of Visual Studio is quite helpful for determining the class name of a window.
modified 14-Nov-13 22:48pm.
|
|
|
|
|
Works beautifully!!!! I've been trying everything and was resorting to using SendKeys, not pretty... I may have a small follow up question, but this is great! Thank you!
|
|
|
|
|
You are welcome.
You may want to read this[^] article if you have any problems getting the handle to your external application's window. I hate to enumerate windows, but many times it is the only way.
|
|
|
|
|
Dear Friends,
im using MS excel2003 VBA I created code to pull the data from one sheet to another sheet in same workbook using queries. But im getting error on ODBC Connection.
"" [Microsoft][ODBC Driver Manager] Data source name not found and no Default driver specified""
How to fix this error?????
|
|
|
|
|
It probably means you are missing a library component. However, your question is not clear, please show what your code is doing.
Veni, vidi, abiit domum
|
|
|
|
|
This error is commonly shown if you have no ODBC driver installed, or the installed version does not match the version you are referring in your code.
Or the data source can't be found, maybe a typo?
|
|
|
|
|
Hi,
I connected MySQL Database installed in Windows PC through network (Coded in VB.NET).
But one of my clients wants to install MySQL in Linux PC where the client PCs' OS are windows. He has the network installed.
My question is to do the above in VB.NET what should be
1. the process(how to),
2. connection string,
3. port #,
4. Firewall settings for both windows and Linux OS
and
5. others (if any).
I cannot test it right now as I do not have Linux installed anywhere. Is it just like the procedure in which I connected MySQL database installed in Windows PC? I used MySQL connector.NET to connect. If I want to connect Linux PC, what should I use? MySQL Connector/NET or MySQL Connector/ODBC ?
modified 13-Nov-13 9:29am.
|
|
|
|