DemonSeed wrote:Ok so it isnt in the user folder but in the program folder?
APorter wrote:Thanks for posting. I ran this last night without any problems. What happens when you add a new movie to a folder that is part of the .bat file?
tyborg wrote:I wish I knew how to hardcode something like this into the source code to create the effect on your images.
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
RoundAndSave(MergeImages(new Bitmap(@"C:\28_Weeks_Later.jpg")));
}
private static Bitmap MergeImages(Bitmap image)
{
Bitmap imageMerged = image;
Graphics mergedGraphics = Graphics.FromImage(image);
Rectangle rectangle = new Rectangle(0, 0, image.Width, image.Height);
mergedGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
mergedGraphics.SmoothingMode = SmoothingMode.AntiAlias;
mergedGraphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
mergedGraphics.CompositingQuality = CompositingQuality.HighQuality;
mergedGraphics.DrawImage(image, rectangle);
mergedGraphics.DrawImage(ResizeBitmap(Properties.Resources.Overlay, image.Width, image.Height), rectangle);
mergedGraphics.Save();
return imageMerged;
}
private static void RoundAndSave(Bitmap image)
{
Bitmap bitmap = new Bitmap(image.Width, image.Height);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.Transparent);
g.SmoothingMode = SmoothingMode.AntiAlias;
FillRoundedRectangle(g, new Rectangle(0, 0, bitmap.Width, bitmap.Height), 150, new TextureBrush(image));
g.Dispose();
bitmap.Save(@"c:\28_Weeks_Later_Rounded.png", ImageFormat.Png);
}
public static Bitmap ResizeBitmap(Bitmap bitmap, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage(result))
{
g.DrawImage(bitmap, 0, 0, width, height);
}
return result;
}
public static void FillRoundedRectangle(Graphics g, Rectangle r, int d, Brush b)
{
g.FillPie(b, r.X, r.Y, d, d, 180, 90);
g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90);
g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90);
g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90);
g.FillRectangle(b, r.X + d / 2, r.Y, r.Width - d, d / 2);
g.FillRectangle(b, r.X, r.Y + d / 2, r.Width, r.Height - d);
g.FillRectangle(b, r.X + d / 2, r.Y + r.Height - d / 2, r.Width - d, d / 2);
}
}
}

DemonSeed wrote:Tyborg,
I just wanted to say thanks for sharing such a cool new way to mod Media Browser. I have done all of mine and I love my new look.
But I do have A question for you would it be possible to use this method to do this to my covers as well?
I do have the psd that UltimaUser made available so I can probably do whatever I need to, to make this happen but would love some help.
Thanks again for everything so far!
DemonSeed
markkeogh wrote:tyborg wrote:I wish I knew how to hardcode something like this into the source code to create the effect on your images.
This is 99.9% there, but I have to get back to doing my actual work so can't finish it ;-) The only issue outstanding is the rounded and merged image has thin lines on it from the FillRectange I suspect. You'll see what I mean when you run it.
It's quick, dirty and needs tidying up but should do the things your after. I got the FillRoundedRectangle function off the net sometime ago for just such an occasion.
- Code: Select all
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
RoundAndSave(MergeImages(new Bitmap(@"C:\28_Weeks_Later.jpg")));
}
private static Bitmap MergeImages(Bitmap image)
{
Bitmap imageMerged = image;
Graphics mergedGraphics = Graphics.FromImage(image);
Rectangle rectangle = new Rectangle(0, 0, image.Width, image.Height);
mergedGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
mergedGraphics.SmoothingMode = SmoothingMode.AntiAlias;
mergedGraphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
mergedGraphics.CompositingQuality = CompositingQuality.HighQuality;
mergedGraphics.DrawImage(image, rectangle);
mergedGraphics.DrawImage(ResizeBitmap(Properties.Resources.Overlay, image.Width, image.Height), rectangle);
mergedGraphics.Save();
return imageMerged;
}
private static void RoundAndSave(Bitmap image)
{
Bitmap bitmap = new Bitmap(image.Width, image.Height);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.Transparent);
g.SmoothingMode = SmoothingMode.AntiAlias;
FillRoundedRectangle(g, new Rectangle(0, 0, bitmap.Width, bitmap.Height), 150, new TextureBrush(image));
g.Dispose();
bitmap.Save(@"c:\28_Weeks_Later_Rounded.png", ImageFormat.Png);
}
public static Bitmap ResizeBitmap(Bitmap bitmap, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage(result))
{
g.DrawImage(bitmap, 0, 0, width, height);
}
return result;
}
public static void FillRoundedRectangle(Graphics g, Rectangle r, int d, Brush b)
{
g.FillPie(b, r.X, r.Y, d, d, 180, 90);
g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90);
g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90);
g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90);
g.FillRectangle(b, r.X + d / 2, r.Y, r.Width - d, d / 2);
g.FillRectangle(b, r.X, r.Y + d / 2, r.Width, r.Height - d);
g.FillRectangle(b, r.X + d / 2, r.Y + r.Height - d / 2, r.Width - d, d / 2);
}
}
}
Users browsing this forum: No registered users and 1 guest