Showing posts with label examples. Show all posts
Showing posts with label examples. Show all posts

Wednesday, September 15, 2010

Fireworks CS5 to Catalyst CS5

I've been testing out workflow models for the handoff and development of creative assets. A recent advent in the process is Adobe Catalyst, an application offering an intermediary step between design and development.

While that is an oversimplification, the conceptual center of this new workflow is the FXG or Flash XML Graphics filetype. FXG has been prominently positioned in Adobe CS5 to concisely describe graphics. In part, this is achieved by leveraging MXML to describe mathematically-reproducible graphical elements. The remaining visual information is stored in an autogenerated subdirectory in the form of PNGs.

This helps to conserve visual fidelity as well as minimize file size. FXG represents a bold attempt to organize vector and bitmap graphics into a meaningful and portable divisional structure. The language is itself a form of XML that can be dropped into the Flash pipeline and referenced as namespace objects.

All this sounds great, and hopefully the details will fall into place. On that note, here are some instances where the details are still lacking. Some tests follow in the Fireworks to Catalyst workflow.

Here are some Fireworks objects with fills and textures chosen from Fireworks preselected options.



Here are those objects imported into Catalyst.

As you can see, they are not the same. At issue are textures that only render with certain complex gradient fills, and not with others or with solid fills. In particular see column 2 rows 1 through 3.

In row 1, a grid texture is combined with a silk gradient fill. FXG faithfully captures this combination.

In row 2, a DNA texture is combined with a linear gradient fill. FXG translates the gradient to xml markup but ignores the texture.

In row 3, a DNA texture is combined with a silk gradient fill. FXG captures both.

Moreover, note that FXG generally fails to preserve the objects' textural information, despite the fact that texture is a standard option in the Fireworks toolset.

In summary, there are anomalies that must be worked out before a Fireworks to Catalyst workflow can be reliably implemented within Adobe CS5.

Wednesday, April 1, 2009

httphandlers and asp.net

HTTPHANDLERS

They're a critical link in remoting, such as between a .Net application and a Flex presentation server. They can also be customized for other uses, such as dispatching synchronous or asynchronous data. Once you break the seal on httphandlers, you will likely discover they are profound in their utility.

This example demonstrates how to use HttpHandler technology using Asp.Net2.0 and C#.NET

This tutorial only uses the default namespace. The System namespace contains the EventHandler.

HttpHandler is a class that implements the IHttpHandler and IHttpAsyncHandler interfaces. This section describes how to create and register HttpHandler and provides examples of a synchronous handler, an asynchronous handler, and a handler factory.

First, you need to create a classlibrary HttpHandlerDLLVB. The code as follows:



using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace HttpHandlerDLL
{
public class MyHttpHander : IHttpHandler,IReadOnlySessionState
{
public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
context.Response.Write("<h1><b>HttpHandler Test</b></h1>");
context.Session["Test"] = "Invoke a session in HttpHandler.";
context.Response.Write(context.Session["Test"]+"<br>");
context.Response.Write("<a href='HttpHandlerCsharp.aspx'><b>return</b></a>");
}
}
}

Then create a website project and reference classlibrary HttpHandlerDLLVB.dll.

At last configure your web.config as follows.

<httpHandlers>
<add verb="*" path="ViewHttpHandler.aspx" type="HttpHandlerDLLVB.HttpHandlerDLLVB.MyHttpHandlerVB,HttpHandlerDLLVB"/>
</httpHandlers>
The front end HttpHandlerVB.aspx page looks something like this:

<a href="ViewHttpHandler.aspx">Test HttpHandler</a></p>
</div>
The flow for the code behind page is as follows.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}

Thursday, November 6, 2008

Example of GridView Architecture

I'm pasting this code snippet in for posterity. I had intended to make use of the RowDataBound event to alter Web Controls nested within the rows of a GridView.

I successfully obtained all the properties I needed. In the final implementation, the code will be in the main constructor. This is due to the lack of a GridView in its entirety as GridViewRow events are called.

protected void PhotoGalleryGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (!IsPostBack)
{
//Test to see which Row was bound for each RowDataBound event
GridView theGridView = (GridView)sender;

//get rownum for the event
int myRow = e.Row.RowIndex;

//init rowID to value of 0
int rowID = 0;

//if rownum is a body row, run the operation
if (myRow > -1)
{
//get the ID to associate
rowID = int.Parse(theGridView.DataKeys[myRow].Value.ToString());
int numRows = PhotoGalleryGridView.Rows.Count;

//locate the checkboxlist
CheckBoxList CheckBoxList1 = (CheckBoxList)PhotoGalleryGridView.Rows[myRow].FindControl("NonEditableCheckBoxList");
CheckBoxList CheckBoxList2 = (CheckBoxList)PhotoGalleryGridView.Rows[myRow].FindControl("EditableCheckBoxList");

//create an API for testing values
ApplicationAssociationsBLL appAssociationsAPI = new ApplicationAssociationsBLL();
ImperialConcrete.ApplicationAssociationsDataTable associations = appAssociationsAPI.GetApplicationAssociationsByPhotoID(rowID);
//ImperialConcrete.ApplicationAssociationsRow association = associations[0];

//update the values for the lists
for (int i = 0; i < CheckBoxList1.Items.Count; i++)
{
//Get CheckBoxAttributeID for sql operation
int CheckBoxID = int.Parse(CheckBoxList1.Items[i].Value);
foreach (ImperialConcrete.ApplicationAssociationsRow association in associations)
{
if (association.ApplicationID == CheckBoxID)
{
CheckBoxList1.Items[i].Selected = true;
break;
}
else
CheckBoxList1.Items[i].Selected = false;
}
}
}
int stopper = 1;
}
}