There is one thing that is very strange however, I've found that if I zoom
in a lot (beyond a users' normal needed amount) I get an untrappable
exception from the Forms dll.
Originally it seemed that just keeping the helper picturebox below 20k
pixels width or 20k pixels height woud solve thed problem, but more testing
killed that idea.
Currently I'm using the hopeful trap of keeping the width and/or height
below 10x the VirtualScreen dimensions. That seems to work in my test
scenarios so far ... but I don't know if it's really just luck. (since the
actual limits seem to vary by image type and resolution)
Has anyone else seen this untrappable error?
If you have a second, you can jump directly to the details in the
documentation page:
http://www.doitin.net/svICdemo4.htm#untrappable
Please posts ideas to this group.
Thanks for your time.
Robert Smith
Kirkland, WA
"robert smith" <smithgetri...@smithvoice.com> wrote in message
news:Oai$KOMrCHA.2256@TK2MSFTNGP12...
But even still: No. The code I've seen to work scrollbars off of images
without a picturebox display has been, in my humblest opinion, way too
flash-prone. Lots of lines of code, very impressive code, but so far as I
have seen, not providing as good and experience for the end user.
With the picturebox you get all the sizing - except for the Forms.dll issue
which is not a real major issue - with no flashing, jus smooth movemens.
Do you know of a better route that will actually work better,. no flashing,
no choppy displays?
Thanks, Frank.
-s
"Frank Hileman" <fran...@no.spamming.prodigesoftware.com> wrote in message
news:uh9qm5OrCHA.2396@TK2MSFTNGP10...
"robert smith" <smithgetri...@smithvoice.com> wrote in message
news:uga$KGQrCHA.1644@TK2MSFTNGP09...
Well, it is easy to get rid of flashing. Choppy would be a performance
problem. GDI+ has a couple calls that will display part of an image, crop
it, and scale it, all at the same time. So it does not look like "lots of
lines of code". You still need scroll bars. UserControl can do that.
Your problem may be from creating a giant image and running out of memory or
overflowing a coordinate (not in your code, but the MS code). Using the
DrawImage(Image, Point[], Rectangle, GraphicsUnit) call you can scale, crop,
and pan, all without creating a new image. I don't know how fast it is.
Because it does not create a new image, it probably will not have that
blowup problem, but it may be slower to pan, because it has to interpolate
on every repaint (interpolation quality can also affect speed). I worked on
a graphics system where the user had to pick between infinite zoom or fast
pan -- we had the same trade-off. If we cached the zoomed image, it could
take a long time to zoom in, and they might run out of memory. If we did
not, zooming was fast, no limits to zooming, but panning was slower.
Here is the DrawImage link:
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawinggraphic
sclassdrawimagetopic9.asp
To get rid of flashing you double buffer. Here is an article. And the next
link is a presentation and sample about GDI+ performance.
http://www.gotdotnet.com/team/windowsforms/windowsformspainting.aspx
http://windowsforms.net/samples/DEV354.zip
I imagine a custom control made this way would be as fast or faster than the
picturebox.
By the way, I enjoyed your articles, even though I am a C# developer.
Regards,
Frank Hileman
"robert smith" <smithgetri...@smithvoice.com> wrote in message
news:uga$KGQrCHA.1644@TK2MSFTNGP09...
I'm using DrawImage for the fixing of Tifs (fax compression commonly sets
the Y resolution to half of the X, I restore al images by a clone then a new
birtmap then a blast of the original using DrawImage.
No offense against C# at all, though I am a tad tired of seeing C++ folks
say that in C# the world has something so totally brand new, only to find
that much of what they're excited about is old to VB :) (No, no ...not
trying to start that old thing again <G>)
The next part I just have to write, it's how to draw templates that later
are filled in on demand, with dynamic text, rectangles, etc, etc. The
control alread described just takes an XML string to fill the template and
they the text and checkbox drawing is done on dynamically (and flash-free)
at runtime. It has saved me a lot of time, is OOP so easy to work with and
might interest some others.
-s
It is definitely not just the size of the picturebox because you can set
that width or height to anything you want (and, oddly, anything over the
traditional VBClassic Integer - Int16 - will just force it to be that 32767
with no exception and no alert) so it does have to be in the GDI+.
I have that book, it *is* very good.
Thanks again.
-s
"james" <jjam...@earthlink.net> wrote in message
news:#D4HfrQrCHA.1080@TK2MSFTNGP10...
whew, I have to learn to stop being so vb-centric now that .net is here :)
-s
I find the new keywords in VB.net for OOP too wordy, but functionally it is
almost identical to C#. I thought the language wars would die down now that
classes can be reused across languages. This did not happen.
"robert smith" <smithgetri...@smithvoice.com> wrote in message
news:u#hTKRVrCHA.2496@TK2MSFTNGP12...