ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Photo Downloader Kiosk

<< < (7/9) > >>

mouser:
thanks for sharing -- i'm sure skrommel won't mind.
(you could also attach the file as an .ahk)

NinJA999:
I will probably attach it once I finish adding a few other user-friendly features I'm working on.  Again, Skrommel, if you mind, I'll take down the code and just use the features on my own personal system.

Target:
I realise that this is probably a non issue given the work already done on Skrommels script, but I really hate to leave a job half done...

've amended my code so that it works as intended, ie it correctly detects removable media.  Also added the option to set the defaults (from the tray menu).

still looking at displaying image aspect ratio correctly...

VideoInPicture:
I haven't played around with the AHK code enough to give a good image scaling function in that will preserve the aspect ratio in AHK, but below is what I wrote to scale images in Circle Dock that preserves the aspect ratio while maximizing the image size given a desired size. I think it should be pretty easy for you guys to transfer this C# code to AHK form.


--- Code: C# ---/// <summary>         /// Returns a bitmap resized to fit inside NewWidth and NewHeight without aspect ratio change. Uses high quality scaling.        /// Returns null if an error is encountered.        /// </summary>        /// <param name="Bitmap">Image to resize.</param>        /// <param name="NewWidth">Width of the resized bitmap.</param>        /// <param name="NewHeight">Height of the resized bitmap.</param>        public static Bitmap ScaleBySizeBestFit(ref Bitmap Bitmap, int NewWidth, int NewHeight)        {            try            {                Bitmap scaledBitmap = new Bitmap(NewWidth, NewHeight);                 // Scale the bitmap in high quality mode.                using (Graphics gr = Graphics.FromImage(scaledBitmap))                {                    gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;                    gr.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighSpeed;                    gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;                    gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;                     double scaledBitmapAspectRatio = (double)scaledBitmap.Width / (double)scaledBitmap.Height;                    double sourceBitmapAspectRatio = (double)Bitmap.Width / (double)Bitmap.Height;                     int bestLeft, bestRight, bestTop, bestBottom, calcWidth, calcHeight;                     if (sourceBitmapAspectRatio > scaledBitmapAspectRatio)      // The source bitmap is wider                    {                        bestLeft = 0;                        bestRight = scaledBitmap.Width;                         calcHeight = (int)((double)scaledBitmap.Width / sourceBitmapAspectRatio);                        bestTop = (scaledBitmap.Height - calcHeight) / 2;                        bestBottom = calcHeight;                    }                    else                    {                        bestTop = 0;                        bestBottom = scaledBitmap.Height;                         calcWidth = (int)((double)scaledBitmap.Height * sourceBitmapAspectRatio);                        bestLeft = (scaledBitmap.Width - calcWidth) / 2;                        bestRight = calcWidth;                    }                     gr.DrawImage(Bitmap, new Rectangle(bestLeft, bestTop, bestRight, bestBottom), new Rectangle(0, 0, Bitmap.Width, Bitmap.Height), GraphicsUnit.Pixel);                }                 return scaledBitmap;            }            catch (Exception)            {                return null;            }        }    }

NinJA999:
Okay, so here's the version I'll probably end up using for the tournament.
Again, Skrommel, if you mind, I'll take down the code and just use the added features on my own personal system.

http://aldwin.us/PhotoKiosk/ - here you can find the PhotoKiosk AHK along with the needed icons
http://aldwin.us/PhotoKiosk/PhotoKiosk.exe - A direct link to the EXE (contains all needed icons)

If it seems OK, maybe this topic is now DONE instead of IDEA?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version