|
|
"Text oriented"?? Never heard of it.
Yes, VB.NET is fully object oriented, as is the entire .NET Framework BCL and .NET CLR.
|
|
|
|
|
If anyone can help with this I'd be grateful! Using VB.2008 express, I'm trying to improve my GPS tracking program by building in the ability to handle multiple large map tiles and tile them into one larger image. Previously I've used only a single map tile and let the program load the one on which the GPS plot is drawn, but there's now a need to scroll across a much larger area of the country. I've searched for code to handle this and come up with only one example which contains the line:-
bltImage = New Bitmap(8000, 8000, Imaging.PixelFormat.Format32bppPArgb)
The map tiles are then read from an array and drawn on the base image.
The '8000' values are mine as the map tiles I'm handling are 4000 pixels x 4000 pixels. I'd very much like to use a dynamic grid of 9 tiles held in the array, which requires the background image (bltImage) to be 12000 x 12000 (I'm assuming) If I use these values the code fails with either a 'Win32 error' or a 'Generic GDI+' error depending on the exact value I increase to. I can usually get away with 9000 x 9000 but I have no control over the original tile sizes and so must work in multiples of 4000. It appears not to matter which type of control I try and load the tiles into, a plain form, a picture box, or a modified version of the excellent image viewer designed by one of the contributors to this site. They all fail if the background image is increased in size to 12000 x 12000. If any can shed any light on where I'm going wrong.....
Thanks in anticipation.
Rob Brookes
|
|
|
|
|
Rob Brookes wrote: They all fail if the background image is increased in size to 12000 x 12000. If any can shed any light on where I'm going wrong.....
GDI won't hanlde an image that large (12000*12000*4 bytes per pixle = 576MB) and that doesn't account for the source images your using to build the single ackground image. The answer is you can't use an image that large, nor should you be using a control to do the drawing for you. You're going to have to make your map by drawing it to the screen yourself, handling scrolling and redrawing from your original source images with your own code.
|
|
|
|
|
Very many thanks for the reply Dave, I'd largely come to that conclusion unfortunately. I've had a partial success by re-scaling the map tiles, as they're loaded, to 3000 x 3000 which works with no noticable effect on the performance of the program. I lose some map resolution but can probably live with that. My coding ability doesn't allow me to draw directly to the screen as yet but I'm working on it. Normally the program dynamically loads the map it needs as a position report is received by the radios but I'm limited to the area covered by the map tiles that way. If a plot appears on the extreme edge of one tile, the program stutters somewhat as it can't decide which tile to load hence I need to buffer the edges of each tile, and one in the centre with another 8 in the wings seemed the most obvious way of doing it. Understandable information on VB.net graphics handling seems a bit thin on the ground. If you can recommend anything to read, I'd much appreciate that.
Regards
Rob
|
|
|
|
|
|
This is the VB.Net forum.
|
|
|
|
|
I want to develop scientific calender control for window application
|
|
|
|
|
So, what is your question?
Shay Noy
|
|
|
|
|
VERY GOOD
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
I presently have a class which inherits another class, thus allowing methods and properties of the base class to be used as though they were properties of the inheriting class. Although that reduced typing when I was making the class itself, I've since decided I don't particularly like the design since operations that make sense applied to the base class don't necessarily make sense applied to the inheriting one, and even those that do would be more meaningfully applicable to the object within the inheriting class rather than to the inheriting class object itself.
If all references to the underlying base class were preceded by "mybase." there would be no particular difficulty changing the class to use a wrapper. All I'd have to do would be to define a new object of the inner type within the outer class, create it within the outer class' constructor, and then find/replace "mybase" with the name of that new object.
Is there any practical way to have VB stick "mybase." in front of all inherited properties and methods, or assist with the conversion in some other way?
One of my goals with switching from inheritance to wrapper is to allow the use of something like:
wrapperObject.thing = factoryFunction(someOtherThing)
This sort of scenario really doesn't work if 'thing' is inherited, since wrapperObject.myBase is a read-only property.
|
|
|
|
|
supercat9 wrote: Although that reduced typing when I was making the class
That isn't really a valid reason for inheritance.
supercat9 wrote: operations that make sense applied to the base class don't necessarily make sense applied to the inheriting one
When deciding to create a derived class you have to ask yourself: is the derived class a specialised type of the base class. The derived class must have an IS-A relationship with the base class. For example, a spaniel IS A dog, a dog IS A mammal, a mammal IS An animal, an animal IS A lifeform.
supercat9 wrote: If all references to the underlying base class were preceded by "mybase." there would be no particular difficulty changing the class to use a wrapper. All I'd have to do would be to define a new object of the inner type within the outer class, create it within the outer class' constructor, and then find/replace "mybase" with the name of that new object.
I am having difficulty visualising what you mean. I suspect what you actually want is an association between the derived class and the base class rathern than inheritance, possibly with the base class and associated class sharing some common interface. However, you have not provided enough information. Your description is too abstract but it looks like you don't understand enough of the underlying concepts to be able to describe things at that level. Perhaps if you described your actual problem instead of attempting to hide what you are trying to do then we can help.
|
|
|
|
|
Colin Angus Mackay wrote: That isn't really a valid reason for inheritance.
I figured that out after I'd written a lot of the code. That's part of the reason I'd like to change the relationship to a wrapper class.
Colin Angus Mackay wrote: I am having difficulty visualising what you mean. I suspect what you actually want is an association between the derived class and the base class rathern than inheritance, possibly with the base class and associated class sharing some common interface.
Right now what I have is a generic hierarchical collection class (hCol) which supports some features beyond the normal dictionary class, and which (more importantly, though somewhat gruesomely) I was able to implement compatibly in vb.net and vb6 (both version support serialization and deserialization, and the serialized forms are interoperable).
I also have a class which contains methods to query and set the state of external microprocessor-controlled devices using the hierarchical collection class. This class doesn't have very many fields of its own, but instead most of the information associated with the device is stored in the inherited hCol object.
Effectively, what I'd like to do is change the relationship from "A gizmo is an hCol with some other stuff" into "A gizmo is an object that contains an hCol called theHC, along with some other stuff". To do this, it would be necessary to stick "theHC." in front of all references to instances methods, properties, and fields of the underlying class, and "hCol." in front of all the shared methods, properties, and fields.
I was wondering if there's any way that VB could assist with that, since it provides so many other nice features. If VB could stick "mybase." in front of all non-overridden inherited references, that would leave the code functionally identical to what it would be without mybase, but it would then be possible to find/replace "mybase" with "theHC" and have the class behave as a wrapper.
Much of the code that uses the class would be broken by the change, but that could be fixed by adding to the "gizmo" class wrapper methods for the properties that get used most often (most notably the default subscripting property), and adding properties to access the underlying hCol object when trickier operations are required.
If the only practical way to do the conversion is to remove the "Inherits" statement and then patch all of the blue-underlined code, I could do that, but if there's a more convenient method it would be good to know it.
Colin Angus Mackay wrote: Perhaps if you described your actual problem instead of attempting to hide what you are trying to do then we can help.
Sorry to be mysterious. As a contract engineer, I'm not always certain what information clients would consider 'sensitive', so I try to be discrete. Further, when asking questions, I try to focus on the essence of the question rather than posting oodles of information about exactly what I'm doing, much of which wouldn't really be relevant to the issue at hand.
I hope the above description of what I'm doing is helpful.
As for level of understanding, I've been writing code for embedded systems for over 15 years. I've been maintaining for about five years a mess of VB6 code someone else wrote, and started about six months ago working with Visual Studio.net, mostly working in vb.net but also integrating unmanaged C code. I've also become a lot more intricately familiar with vb6 over the last six months, and increasingly amazed at how broken its object handling is (the existing mess of vb6 code didn't define any new classes until about six months ago).
At this point, I know a way to do most of the things I need to do with vb.net, but recognize that I still have a lot to learn. Knowing how to turn a "foo" into a "glorp", a "glorp" into a "boz", and a "boz" into a "bar" means that I know a way to turn a "foo" into a "bar", but that doesn't mean I know how it should be done. I'd like to avoid getting into too many bad habits, so advice in the right direction would be helpful. Thanks for any assistance you may provide.
|
|
|
|
|
Perhaps the magic word you are looking for is "Protected".
All methods and variables with this keyword are accessible from all depending classes without the keyword "mybase".
Nevertheless, the design considerations mentioned above are important and need to be checked.
Perhaps a refactoring of the code may be necessary.
Regards
Thomas
|
|
|
|
|
Perhaps the magic word you are looking for is "Protected".
Maybe, but I think changing the code so that a gizmo contains an hCol rather than being an hCol is almost certainly a better approach. I'd just been hoping there was an easy way to make the change without hand-patching all the code.
|
|
|
|
|
Colin brought up some excellent points, so I won't repeat them here.
supercat9 wrote: Is there any practical way to have VB stick "mybase." in front of all inherited properties and methods, or assist with the conversion in some other way?
There is not an automated (or even somewhat automated) way to do this type of refactoring. The best approach would possibly be to let the compiler help you find the methods you need to update by making the changes to refactor to a container and then see what causes the compiler to fail.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
Hi All
I have one application in vb.I have problem with crystal report.
I have one annual report in crystal report.
Problem is: annual report means apr 2000 to march 2001
I have database in access.simaple annual report is ok but i have no idea how to
fire query on two year in crystal report means how to get all records from two table with two parameters?
I hope u r getting my point.
if possible pls reply as early as possible
Thanks
monika
|
|
|
|
|
Hi
Please explain more and are u using web or windos application and what kind of DB u r using
Mohammad Al Hoss
|
|
|
|
|
hi
Thanks for yr reply.
But i think u r not getting my point.
I have access database and windows application with vb.
My problem is when i take report as quaterly it's working fine
but when i take report as annualy,it creates problem
how i explain u.
i have student database.Two tables student and presence
annual report means suppose april 2006 to may 2007.
My problem is how to pass two parameters from vb to crystal report and how to access all records based on 2006 and 2007
means if have one record as name "monika" i want to fetch record from apr to dec 2006 and jan to may 2007 for monika.
I have two entry in database for monika.
This is tha mymajor problem
Pls help me and try out solve this problem.
Thanks
monika
|
|
|
|
|
Hi,
as i understond u need to get info from date to date this can be done by write the query u need in VB then use :
Dim oledt As New OleDbDataAdapter
Dim dt As DataTable
oledt.Fill(dt)
Crystalreport1.SetDataSource(dt)
sure when u design the report u design to the table or query then write the query u need and execute it.
also if it is ok mail me back
Mohammad Al Hoss
|
|
|
|
|
Hiiiiii
I m developing outlook-2003 Add ins using vb.net 2005. and i want to add the custom task pane in outlook reply window. means when user open a mail and click on Reply button the new mail to windows is displayed. and i want to add custom task pane in this window. Please suggest how i do this.
Thanx
Mitesh Khatri
Khatrimitesh@hotmail.com
|
|
|
|
|
Hello,
I got stuck to one problem and need your help.
In my asp.net application i am using RegEx (regular expresiion) to get all the emailids enclosed in a
particular html tag.
For ex : see the code below line1
<to> test@test.com, user1@user.com </to> -----line1
This statement could repeat in my textbox multiple times with same or different mailids enclosed.
So finally regex should return two emailids w.r.t. to above example line1.
now line1 generates different html with different mail providers like yahoo, rediffmail gmail.
for ex for outlook generated html, i have written
Dim S As New Regex("<to>(.*)</to>", RegexOptions.Multiline Or RegexOptions.IgnoreCase Or RegexOptions.Compiled)
this returns the expected result but if i press enter before closing to tag then ids get converted to hyperlink and href get inserted into html code.
then i pass this statement to regex i dont get expected result.
Let me tell you that i pass html code generated as a string to regex and expecting that it should return all emailids
enclosed in the code removing duplications and irrespective of other symbols or tags.
so my query is how i could retrieve the emailid s from any generated htmls.
Please anyone who knows provide me the code.
thanks in advance.
|
|
|
|
|
I am working at VS2008 and SQL Server2005.I want to put login restriction that after 100 logins is done by the same user after that he will not able to log thruogh the user name.
|
|
|
|
|
On the database side you can use SQL Server's logon trigger to count the user's logins. On the app side you are on your own.
|
|
|
|
|
Thanks for your reply.Can you give the query for SQLServer2005.Pls help me.
|
|
|
|
|