About the author

Name of author Kevin Brammer lives in Houston and spends most of his time painting, designing, and programming ASP.NET/C#.
E-mail me Send mail

Pages

Advertisements

 

Using the Opacity Mask in Illustrator

by Admin 11/11/2008 5:05:00 AM

Before I discovered the Opacity Mask in Illustrator, I thought that it was only possible to do complex transparencies in Photoshop. However, it is actually pretty simple to acheive many of the same effects in Illustrator using the Opacity Masking feature in the Transparency Panel.

For instance, in order to create a text reflection in Illustrator, simply type the desired text on a fairly dark background.

Then duplicate the text, right click to select Transform>Reflect>Horizontal, and line this up underneath the original text.

Now you need to create a simple rectangular black and white gradient and cover up the text on the bottom. The blacks will become transparent and the whites become opaque once you apply the mask, so you can experiment with the gradient settings to get things just right for your purposes. There is an option on the Transparency Panel to invert the mask as well, in case you would rather have the blacks opaque and the whites transparent.

Make sure to select both the text and the gradient you just created, taking care not to select anything else like the background. You can select the background and press CTRL+2 to lock it down if you are having trouble selecting items on top of it. Simply CTRL+ALT+2 to unlock it when you need to select the background again. Open the Transparency Panel, and select Make Opacity Mask from the Transparency Panel Options Menu.

Adjust the general opacity to taste. Also, notice that the Transparency Panel has an option for you to select the masked object or the mask itself and work with each of these items individually if necessary - just click on the left or right box to select it.

The rest is up to you. I decided to adjust the background gradient to create more of a horizon line, placing the darkest background colors towards the bottom.

 

  

Here is the source Illustrator CS3 file in case you are interested: shiny.ai (155.05 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Illustrator

Bulk File Renaming Utility

by Admin 10/28/2008 4:58:00 AM

Here is the link to a great file renaming utility that I use:
http://www.bulkrenameutility.co.uk/Main_Intro.php

It is free and powerful. It has a learning curve, but it’s worth it. It works great with Vista, too.
The main "boxes" I use are the replace box, which works just like a traditional search and replace, and the prefix box, which simply adds letters to the beginning of your filenames. You can also change the file extensions using the extension box:

The trick is to make sure you highlight the files you want to change the name for. A preview of the filename will automatically show up next to the original filename so you can check your results before you click the rename button.

Enjoy!

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Vista

Yahoo Style GridView Theme Using CSS

by Admin 9/11/2008 8:25:00 PM

Live Demo

I just added a Yahoo style GridView theme to the sandbox, which is designed to work with an out-of-the-toolbox GridView control. I wanted to experiment with sprite design, where all of the backgrounds are combined in one image and shifted using CSS. All in all, I think it works fairly well ^_^

As usual, I have tried to keep all my themes as simple as possible to implement. You can check them out here.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Mapping to WebDAV folder with Vista

by Admin 7/30/2008 12:01:00 AM

I had been trying for some time to create a mapped network drive to a remote WebDAV folder using Vista, but I was unable to figure this process out until recently. Apparently, Microsoft has a Software Update for Web Folders (KB907306) that enables the Web Folders component in Vista. Once the update is installed, you should be able to map your drive.

  1. Open the Computer icon on the desktop or Start menu
  2. Select "Map Network Drive" in the top toolbar
  3. Select "Connect to a Web site that you can use to store your documents and pictures" 


     
  4. Select "Choose a custom location"


  5. Enter the URL of the folder you want to connect to (i.e. https://www.myserver.com/myfolder/)
  6. Follow the steps outlined in the Wizard, they should be pretty self-explanatory.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Vista

Populate SubSonic DropDown with Distinct Values "System.Data.DataRowView"

by Admin 7/24/2008 8:22:00 PM

I was having a little trouble figuring out how to select only distinct values from a column and populate a dropdownlist using SubSonic and ASP.NET 2.0 C#. Here is my solution:

 

SubSonic.Query q = new SubSonic.Query("Projects");
            q.QueryType = SubSonic.QueryType.Select;
            q.DISTINCT();
            q.SelectList = "ClientName";
            q.ORDER_BY("ClientName");
 
            DropDown1.DataSource = q.ExecuteReader();
            DropDown1.DataTextField = "ClientName";
            DropDown1.DataBind();

 

If you are getting "System.Data.DataRowView" when binding the SubSonic DropDown control programmatically, be sure to check if you set the DataTextField property of the DropDown control to the correct column name.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Photo Gallery Example Using ASP.NET and Flex

by Admin 7/8/2008 1:33:00 PM

I have been dabbling with Flex recently with the intent to try and create a simple XML driven Flash photo gallery with scrolling thumbnails. I am happy with the results so far, although I plan on improving the UX, error handling, load time and adding the ability to browse several categories. Once that's done I'm considering doing the whole project again in Silverlight ^_^

Live Demo

ASP.NET Web Handler

I decided to have the list of photos for the gallery delivered as XML using a standard .NET web handler. This way I can add or delete photos in the future without having to tinker with the Flex application. Since my photos are hosted at Flickr, I chose to use the Flickr.NET API to gather information from a specific photo set on my account and let the web handler format the result as XML. I will eventually also have the web handler respond dynamically to different URL parameters in order to browse more than one photo set. There are a couple of good examples available at the FlickrNet API Library on CodePlex if you haven't used this API before. The most important thing to remember is if you are hosted on a shared server such as 1and1 (like me), you may find that you need to specify a proxy in both the <flickrNet /> and the <defaultProx /> locations in order to make any web requests outside of your host. You will also need to get you API key and secret from Flickr to add to the web.config.

web.config

Setting up flickr.dll and 1and1 proxy:

<configuration>
  <configSections>
    <section name="flickrNet" type="FlickrNet.FlickrConfigurationManager,FlickrNet" 
       allowLocation="true" />
  </configSections>
  <flickrNet apiKey="yourFlickrAPIKeyGoesHere" secret="yourSecretGoesHere" 
       cacheDisabled="true" >
    <proxy ipaddress="ntproxy.1and1.com" port="3128" />
  </flickrNet>
  <appSettings>
    <add key="UserId" value="yourFlickrUserIdGoesHere"/>
  </appSettings>
 
  <!-- rest of web.config -->
 
  <system.net>
    <defaultProxy>
      <proxy usesystemdefault="False"
       bypassonlocal="False"
       proxyaddress="http://ntproxy.1and1.com:3128"
       />
    </defaultProxy>
  </system.net>
</configuration>

Formatting the information returned from Flickr is accomplished by using Mark Rasmussen's XML Output Fluent Interface, which has really been saving me quite a bit of time lately. You can find the class and implementation examples on his site. In this case, I decided to just wrap it under the default web application namespace. Otherwise you'll need to add the appropriate 'using' statement if you decide to add it to another namespace.  Here is the complete code for the web handler:

The Web Handler

flickrfeed.ashx:

<%@ WebHandler Language="C#" Class="Handler" %>
 
using System;
using System.Web;
using FlickrNet;
 
public class Handler : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        String output;
        context.Response.ContentType = "text/xml";
        context.Response.ContentEncoding = System.Text.Encoding.UTF8;
 
        // Assign the XML document
        output = XMLdata();
 
        context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(600));
        context.Response.Cache.SetCacheability(HttpCacheability.Public);
        context.Response.Write(output);
    }
 
    public bool IsReusable
    {
        get { return true; }
    }
 
    public String XMLdata()
    {
        // Get data
 
        Flickr flickr = new Flickr();
        Photoset photos = flickr.PhotosetsGetPhotos("72157600111054287");
 
 
        // Create XML document
        XmlOutput xo = new XmlOutput()
        .XmlDeclaration()
        .Node("images").Within();
 
        foreach (Photo pic in photos.PhotoCollection)
        {
            String _title = "";
            String _image = "";
            String _thumbnail = "";
 
            if (pic.Title != "")
            {
                _title = pic.Title;
            }
            if (pic.MediumUrl != "")
            {
                _image = pic.MediumUrl;
            }
            if (pic.ThumbnailUrl != "")
            {
                _thumbnail = pic.ThumbnailUrl;
            }
            xo.Node("pic").Within()
            .Node("title").InnerText(_title)
            .Node("image").InnerText(_image)
            .Node("thumbnail").InnerText(_thumbnail)
            .EndWithin();
        }
        return xo.GetOuterXml();
    }
} 

An Example of the XML Output

Flex Gallery

Now that I have my Flickr XML feed up and running the way I want it, I can import it into Flex by retrieving it with HTTPService named "photos" and returning it as E4X:

<mx:HTTPService id="photos" url="flickrfeed.ashx" result="xmlQuery(event)" resultFormat="e4x" />

Note that you may need to use a fully qualified URL, such as "http://www.example.com/directory/flickrfeed.ashx" if you want to host your gallery in a different location than your feed. The HTTPService is launched using the "send()" method via the application's "creationComplete" event:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
     creationComplete="photos.send()" backgroundGradientAlphas="[1.0, 1.0]"
     backgroundGradientColors="[#002579, #1D0000]">

At which point the result event is sent to xmlQuery(event) method to create the thumbnails, load the first image and title. One of my goals for the gallery was to have scrolling thumbnails. This proved a little more difficult than I had anticipated, and I still have work to do on controlling the speed and scrolling bounds more accurately.

The scrolling thumbnail effect is achieved in part by using a simple mask, by nesting the larger HBox containing the thumbnail images within a smaller containing HBox. To keep scroll bars from appearing when the content exceeds the bounds of the container, you must set the verticalScrollPolicy and horizontalScrollPolicy to "off". The Move effects are declared in separate MXML tags and added via event parameters within the individual button controls. You can specify a particular target control for the effects using the "target" parameter in the effect tag, and additionally calling the effect using the "play()" or "stop()" methods from the button control:

<mx:Button label="&gt;" id="rightBtn" mouseOver="mr.play()" mouseOut="mr.stop()"  
     height="40" width="33"/>
 
<mx:Move id="mr" xTo="0" duration="1500" target="{tscroller}" />

Flex Flickr Gallery

You can view the FlexFlickrGallery MXML source here.

Here are a couple of Flex related links I found to be useful:

Again, this is just a first step and I always welcome any suggestions and feedback.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

ASP.NET | Flash

PNG Effects

by Admin 6/26/2008 3:42:00 AM

The folks over at www.webdesignerswall.com are having a lot of fun with transparent PNGs to do fun things like create image borders and text effects. I have had a lot of difficulty in the past trying to get PNGs to work in Internet Explorer 6 - but they promote a nifty IE PNG Fix borrowed from twinhelix that seems to get rid of this problem altogether. 

 


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Perfect Pagination Using CSS

by Admin 6/26/2008 2:53:00 AM

Antonio Lupetti has posted a well written tutorial explaining how to style paging controls with CSS to look like Digg, Flickr or clean HTML.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Development

Persisting Data in Your Windows Mobile Device

by Admin 6/24/2008 3:58:00 PM

Wei-Meng Lee has a fantastic post on devx describing how to manage data in .NET mobile applications. I had a particularly hard time trying to gather information on this topic and his tutorial on using XML serialization to generate custom user configuration files was just what I was looking for :-)

The article covers:

Introduction - Storing Simple Data in Text Files

SQL Server Compact 3.5 Database - Storing Complex Data

Creating a SQL Compact Edition Database Programmatically

XML - Configuration Files Using XML Serialization

Thanks Wei-Meng!! 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Mobile

ASP.NET GridView Themes

by Admin 5/31/2008 4:08:00 PM

Cyberslingers GridView Themes

I have posted a few more gridview themes and jazzed up the interface for my preview page a little so that it is easy to switch between different styles and download the source code. I have tried to keep these as simple as possible to implement. You can check them out here.

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Powered by BlogEngine.NET 1.3.0.0
Theme by Kevin Brammer