Want to hire a BMax programmer

BlitzMax Forums/BlitzMax Programming/Want to hire a BMax programmer

Why0Why(Posted 2006) [#1]
Hi, All. I am not sure where to put this, I thought this would be the best area.

I have a program written in VB.net that is functional, but one of the main portions uses the GDI and it is SLLLOOOOWWWW. I am an intermediate Max programmer and can handle most of the program, but I need someone to write a portion for me.

In a nutshell, here is what I need:

The user scans a bed of images from a scanner to a window. They can then crop and the image can be rotated and gamma corrected. Then the image is saved as an 800x600 jpg. They can scan up to 50 images and these are displayed as thumbnails on the same screen. The order of these thumbnails can be changed by dragging and dropping. There is a free TWAIN dll that should be very easy to wrap for what we need. The software is run on a dedicated computer, so no oddball hardware configs.

I can show interested parties the existing software. We can then move onto price from there.

Thanks,

Why0Why


Brendane(Posted 2006) [#2]
Have you tried using GDI+ ?


neilo(Posted 2006) [#3]
I (sorta kinda) agree with Brendane.

You could write the whole thing in VB.net or C# inside a few hours if that's all you want to do. GDI+ is pretty impressive, performance wise (but the memory manager is a real pain with respect to games).

There's always VB Express or C# Express if you don't want to spend money.


Why0Why(Posted 2006) [#4]
I have vb.net and VS 2005 Pro. I am using GDI+. The problem is the only nice way to do thumbnails (that look good) is to use pictureboxes. Windows is rendering 50 pictureboxes, when the form first appears, you can see it rendering the pictureboxes, even on high end hardware.


Dreamora(Posted 2006) [#5]
Problem is I'm not sure it it would be so much better in 3D because if their scaned images are all 800x600 this would mean 4MB VRAM per image (as it would be 1024x1024)

With 50 Images this simply means 200MB VRAM, which is much for a little scanner app.
You could do it with pixmaps, but only few commands of the Max2D command set work with pixmaps.

don't know if VB creates thumbnails before rendering them to picture box but if not, this is most likely what I would suggest to check.
This would be needed within BM as well, as otherwise it would need more than 200MB VRAM as mentioned above.

*it would in any way require 200-300 MB regular RAM to work ... otherwise the reason for crawling is because loading from page file is just deadly slow ...*


ziggy(Posted 2006) [#6]
You can load a image in it's original size and render it in a smaller size with GDI+, so the best way would be to load the big images one by one. I mean, have a function that receives the image in it's original size, and using the render image of the GDI+, returns a small snapshot (a new image with a small size). This way, you don't need to have all big images loaded at the same time. It's the quickest way to do that on GDI+.
by the way, wouldn't it be great to have a Twain library for BlitzMax...?


Jim Teeuwen(Posted 2006) [#7]
Why display all 50 images onscreen?
Get's a tad crowded and not very visible if they are made to fit the screen.

I would suggest only actually displaying a small subset and use some Scrolling functionality.

Have a look at the FilmStrip Displaymode of WindowsXP Explorer. You will only ever have about 8-10 thumbnails onscreen. And if you make sure you generate the smaller Thumbnail from the Original Image, you can make sure it is a fair sight Smaller in terms of memory requirements than simply drawing the original 800x600 with scaling. DrawScaledImage is bloody slow in any language, compared to non-scaled drawing.

This is also easily done in C#.

If this doesnt work for you, I recommend using GDI+ and create a custom Thumbnail control. Using 50 picture Boxes is definatly not the way to go. Just create 1 Large Image in 1 PictureBox and create some 'CopyImageRect' functionality to copy the thumbnail to the large image.

I did this for a small puzzle game in C# 2.0 and it worked brilliantly. It renders up to 100 seperate images this way and does it more than fast enough for Realtime rendering.

The code I used is pure managed GDI, but if you dont mind getting your hands dirty with Native Windows stuff, you can make this even faster by using BitBlt and a host of other native windows Drawing routines. The thing you will be doing here is very similar to drawing a 2D Tilemap. Keep that in the back of your mind when you write it and it'll work out just fine.


Red Ocktober(Posted 2006) [#8]
yeah... sounds like you've already got the right development platform, i did document ocr and search with vb6 and the results were very fast...

displaying 50 thumbnails at once... as asked above, is that really a requirement that needs to be maintained...

also...

look at alternatives to using picturebox controls to display the thumbs...

good luck

--Mike


Why0Why(Posted 2006) [#9]
I appreciate all of the feedback. The application does need to have all 50 viewed at the same time. The order can be changed, and they all need to be visible so they can be dropped in the right spot. The software currently save the image to the hard disk as an 800x600 jpg(very low res, only 50K or so) and then loads it as a thumbnail. So these are not all in memory. The only thing that stays in memory is a hi res scan of the bed so that the images can be cropped without having to go back to the scanner bed every time(there might be 5 separate photos that are scanned in at the same time, this saves tons of time when scanning lots of images.)

The problem is, even when the pictureboxes are empty, it takes forever for the screen to redraw(for example, when the screen is first displayed.) A listbox would work, but it looks so horrible, I won't use it.


H&K(Posted 2006) [#10]
I cannot use GdI, but I would say that I cannot see any reason not to do as suddjested and make a "thumnail size" copy of each image.
Even if you think that this isnt the reason for the problem, it is still seems intuitive that dealing with 50 64X48 bmps, is quiker than 50 800X600 bmps *

*Now Im not sure about this, but isnt a jpg converted to a bmp for access in GDI. Ie it doesnt matter how big it is 0n the disk, it is uncompressed when in memory?

(Dont flame me if thats wrong. Speak to me as if a small child)(I do so prefer being patronised than shouted at)


dynaman(Posted 2006) [#11]
> *Now Im not sure about this, but isnt a jpg converted to a bmp for access in GDI

Everything in memory is treated the same, not as a .bmp but as a memory bitmap (different kinds depending on the current display and what is selected when loading the images). If I remember correctly there are 32bpp and 16bpp image types in .net

So if you are loading them into a 32bpp format (most likely, I believe it is the default) each pixel will take 4 bytes, no matter what the size of the file you originally loaded it from. With 800x600 images that is
1.8 meg (roughly) per picture.

With the 60x48 images it would be 12K per image. (if I have not fudged the math somewhere)


I hope that was not more answer then you were looking for.


Jim Teeuwen(Posted 2006) [#12]
You say you require Drag & Drop functionality to re-order the images. This is quite easily accomplished without having to resort to 50 seperate Picture Boxes.

I did the same as you in my puzzle game initially. All seperate images where put in therir own Picturebox. I felt it needed to be this way because I wanted easy acces to mouse events for ech Image. It didnt matter how large the images where, the result was horribly slow and definatly not worth persueing.

If you can resize the origial images so that 50 of them fit on the screen, you can then draw them all to a single large Image.

You can then use some very simple Bounds checking with the current Mouse position to see which of the thumbs is currently under the Mouse cursor. The actual Dragging code is a breeze.

- User presses mouse on a Thumbnail
- Store the Thumb ID or X/y position within the large image as the Dragging Start-point.
- Then as long as the mouse is pressed you can draw a seperate small image that moves with the mousecursor, preferable a semi-transparent version of the selected thumbnail, or simply an outline rectangle the size of your thumbnail. That way the user can easily see that he is dragging something.
- When the mouse is released, Find the thumbnail again that is under the mousepointer. (You allready stored the first one), and just swap them.


Why0Why(Posted 2006) [#13]
Jim: Thanks for the continued feedback. One issue that makes it more of a pain, is the image isn't swapped, all of the images are bumped up one. Maybe I should send you the VB code and pay you to optimize it...