在canvas中如果设置了matrix(其值不为(1,0,0,1,0,0)),然后使用fillText绘制文本时,绘制出来的文本的字符间距不正确

<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
@font-face {
font-family: 'dimmflmyriadprobold';
src: url('dimmflmyriadprobold.eot');
src: url('dimmflmyriadprobold.eot?#iefix') format('embedded-opentype'),
url('dimmflmyriadprobold.woff') format('woff'),
url('dimmflmyriadprobold.svg#dimmflmyriadprobold') format('svg');
font-weight: normal;
font-style: normal;
.txtBox{font-family: 'dimmflmyriadprobold'; font-size:30pt;}
.txtN{font-size:30pt;}
</style>
</head>
<body>
<span class="txtN"> Contents</span><br/>
<span class="txtBox"> Contents</span><br/>
<canvas id="myCanvas" width="792px" height="1056px" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<script type="text/javascript">
function PDMatrix() {
this.a = 1;//float
this.b = 0; //float
this.c = 0; //float
this.d = 1; //float
this.e = 0; //float
this.f = 0; //float
this.Set = function (a, b, c, d, e, f) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.e = e;
this.f = f;
this.Reset = function () {
this.a = this.d = 1;
this.b = this.c = this.e = this.f = 0;
this.SetReverse = function (mt) {
var i = mt.a * mt.d - mt.b * mt.c;
if (i == 0) return;
var j = -i;
this.a = mt.d / i;
this.b = mt.b / j;
this.c = mt.c / j;
this.d = mt.a / i;
this.e = (mt.c * mt.f - mt.d * mt.e) / i;
this.f = (mt.a * mt.f - mt.b * mt.e) / j;
//fRadian 为弧度(2*Math.PI/360 * o),而非角度;
this.Rotate = function (fRadian, bPrepended) {
var cosValue = Math.cos(fRadian);
var sinValue = Math.sin(fRadian);
var m = new PDMatrix();
m.Set(cosValue, sinValue, -sinValue, cosValue, 0, 0);
var rel = null;
if (bPrepended)
rel = Concat2mt(m, this);
else
rel = Concat2mt(this, m);
this.Set(rel.a, rel.b, rel.c, rel.d, rel.e, rel.f);
this.RotateAt = function (dx, dy, fRadian, bPrepended) {
this.Translate(dx, dy, bPrepended);
this.Rotate(fRadian, bPrepended);
this.Translate(-dx, -dy, bPrepended);
this.Concat = function (a, b, c, d, e, f, bPrepended) {
var m = new PDMatrix();
m.Set(a, b,c,d,e,f);
var rel = null;
rel = this.Concat2mt(this, m);
this.Set(rel.a, rel.b, rel.c, rel.d, rel.e, rel.f);
this.TransFormPoint = function (x, y) {
var fx = this.a * x + this.c * y + this.e;
var fy = this.b * x + this.d * y + this.f;
var rel = [];
rel[0] = fx; rel[1] = fy;
return rel;
this.Concat2mt=function(m1, m2){
var aa = m1.a * m2.a + m1.b * m2.c;
var bb = m1.a * m2.b + m1.b * m2.d;
var cc = m1.c * m2.a + m1.d * m2.c;
var dd = m1.c * m2.b + m1.d * m2.d;
var ee = m1.e * m2.a + m1.f * m2.c + m2.e;
var ff = m1.e * m2.b + m1.f * m2.d + m2.f;
var m = new PDMatrix();
m.Set(aa, bb, cc, dd, ee, ff);
return m;
//PDMatrix.prototype.
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.save();
var text = "Contents";
ctx.fillStyle = "black";
var mt_text = new PDMatrix();
mt_text.Set(9.960,0,0,9.960,473.040,760.860);
mt_text.Concat(1.3333, 0, 0, -1.3333, 0, 1056,false);
var m2 = new PDMatrix();
m2.Set(1,0,0,-1,0,0);
m2.Concat(mt_text.a, mt_text.b, mt_text.c, mt_text.d, mt_text.e, mt_text.f);
ctx.setTransform(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
ctx.font = "normal 0.75pt 'Arrial'";
ctx.fillText(text, 0,0);
ctx.restore();
</script>
</body>
</html>

Ok that's jacked up. . . I put in a normal set of iPod headphones. . . (ones without the push button) and they were fine. Then I plugged my iPhone headphones back in and now auto-magically the sound is balanced again. . .
Very strange. I checked the really obvious stuff before by making sure it was all the way in the jack. . and that the cable didn't have a short in it.
Looks like there are still some gremlins in the code.
Thanks Anyway,
AP
Message was edited by: Apple pHr34k

Similar Messages

  • FRM-13002 : Stacked and Tab Canvas must be created within Content Canvas

    Hi,
    I have a Tab Canvas with 2 pages on it.
    In one of the pages the data to be displayed will be
    out of the region(size or length) of that page.
    I read in this forum for the same problem, the
    member had suggested to use a Stacked Canvas on that
    Tab page alone and enable the scrollbars of the stacked canvas.
    When I drag and drop a stacked canvas on a tab page
    of the tab canvas I get the following error:
    FRM-13002 : Stacked and Tab Canvas must be created
    within content canvas.
    Any help is appreciated.
    Thanks in advance
    Sharath

    Hi,
    I am breaking my head over this.
    I am still unable to solve this issue.
    ========The Requirement is as follows :===========
    When I select a Tab Page of a Tab canvas, I get a
    combo box with items in it. When I select an item from
    the combo box, based on the item selected, I am
    retrieveing the data from the database and displaying
    it in that Tab Page itself. This data is in a matrix
    format. i,e Has a number of rows and columns.
    Without a Horizontal and a Vertical Toolbar attached
    to the Tab Page I would be unable to view all the records
    that are displayed on that Tab Page.
    Any suggestions or examples is most welcome and
    appreciated.
    NOTE : ALso in what situations can we use a stacked
    canvas, if the designer does not allow me to
    use it with other canvases?.
    Thanks in advance
    Sharath.

  • Drawing mc with canvas on it

    Hey,
    I got a problem with displaying canvas on mc, which is drawn on BitmapData object. Code is more or less:
    var can:Canvas = new Canvas;
    can.setStyle("backgroundColor","blue");
    can.width = 100;
    can.height = 100;
    can.x = 100;
    can.y = 100;
    var mc:MovieClip = new MovieClip
    mc.addChile(can);
    var bd:BitmapData = new BitmapData;
    bd.draw(mc);
    this.beginBitmapFill(bd,new Matrix(),false,false);
    this.graphics.endFill();
    And I dont see the canvas. ValidateNow() or callLater doesn't help either.
    On the other if I add a sprite instead of canvas I can see this sprite on screen.
    What should I do and why validateNow() doesn't help in this case?

    thanks for that :)
    my problem is that the nodes are placed inside a panel to appear as draggable entities on the GUI interface using the google web toolkit. that way I need to somehow not put the JPanels in a JFrame but in the panel created by google web toolkit, which I think you cannot do?

  • Tab canvas error

    Dear All
    I am using forms 10g. I have a tabbed canvas and on that i have to create around 15 tabs.
    I have already created 10 tabs .
    Now if i try to add one more tab then when i run the form it is showing some error .
    Please check this error here :-
    http://photos.ibibo.com/albums/view/415782/8488558/error
    http://photos.ibibo.com/albums/view/415782/8488558/error
    What is this error ?
    Is there any limit for creating tab canvas in forms 10g ?

    Hi,
    I am breaking my head over this.
    I am still unable to solve this issue.
    ========The Requirement is as follows :===========
    When I select a Tab Page of a Tab canvas, I get a
    combo box with items in it. When I select an item from
    the combo box, based on the item selected, I am
    retrieveing the data from the database and displaying
    it in that Tab Page itself. This data is in a matrix
    format. i,e Has a number of rows and columns.
    Without a Horizontal and a Vertical Toolbar attached
    to the Tab Page I would be unable to view all the records
    that are displayed on that Tab Page.
    Any suggestions or examples is most welcome and
    appreciated.
    NOTE : ALso in what situations can we use a stacked
    canvas, if the designer does not allow me to
    use it with other canvases?.
    Thanks in advance
    Sharath.

  • How to interpret PageItem.Matrix

    I am using the COM SDK.
    Most of the objects have a Matrix which is going to store the objects rotations, flips, etc.
    Many objects that I see appear to have a translation that takes it to somewhere around 7,000 - 9,000, but it's not constant.
    What is this matrix in relation to? 
    From what point is it translated from?
    When I set the matrix to the "identity" matrix, all the items are flipped upside down.  Why?
    Thanks,
    ...Matt

    You should take a look at AIHardSoftSuite.
    This suite provides functions for converting between different coordinate
    systems used at different levels of Illustrator.
    The geometry of an object is described by coordinates that are relative to
    a pair of imaginary axes imposed on the artboard. Illustrator uses two ways of
    placing these axes; one for storing coordinate information internally, and
    another for passing coordinate information across the SDK functions.
    In the internal coordinate system, the origin is the top left corner of the
    artboard--that is, of the white area that can be seen when zoomed out as far as
    possible. The X axis is horizontal, with the values increasing to the right.
    The Y axis is vertical, with values increasing downward. Values in this
    system are called \e hard, or \e artboard coordinates.
    In the public coordinate system, the origin is the \e ruler origin--that is,
    the point that corresponds to the 0 marks on the ruler when it is visible.
    By default, it is the bottom left corner of the page, but it can be changed by the
    user. The X axis is horizontal, with the values increasing to the right.
    The Y axis is vertical, with values increasing upward. Values in this system
    are called \e soft, or \e page coordinates.
    Most functions in the SDK use the public system of page coordinates, but
    some use the internal artboard coordinates. This suite provides functions
    for mapping between the coordinate systems.          For example, if you pass
    the origin point, [0,0], to \c #AIRealPointHarden(), the function returns the
    vector from the artboard origin (the top left of the canvas) to the page origin
    (the bottom left of the visible page).
    These matrix conversion functions do not convert all
    components of translation matrices. To do this, you must understand
    the details of the two coordinate systems involved and use linear algebra.
    You must analyzed each case. For example, the matrix stored
    in an \c #AIPatternStyle maps coordinates from pattern space to internal
    artboard space, whereas the matrix for an image maps from image space to
    public page space.
    Thomas.

  • Problem: Scalable canvas with affine transformation

    I'm trying to create a canvas that can be scrolled and is scalable through affine transformations. This, I'm trying to achieve by adding a control component to an existing Canvas that listens for MouseEvents and masks the area outside the area defined by the canvas when the control component is created. The base for this component was http://gasi.ch/blog/zooming-in-flash-flex/.
    Next I'm explain how the component is supposed to work and then on to the problem.
    This is how the canvas is created. In the constructor MouseListeners and a mask canvas is added to dragCanvas.
              var canvasControl:MatrixCanvasMouseControl = new MatrixCanvasMouseControl(dragCanvas);
    The listeners work pretty much the same way as in the link I mentioned earlier. So on to the scaling which is the problem.
    The scaling is done by first scaling the dragCanvas with method scaleAt(...):
    /** START OF MOUSE WHEEL LISTENER */
              // CUT
              // get the mouseevent position in stage
              var eventStagePoint:Point = new Point();
                        eventStagePoint.x = event.stageX;
                        eventStagePoint.y = event.stageY;         
              // scale dragCanvas at that point with scaleAt
              scaleAt(canvas, zoomIn, zoomIn, canvas.globalToLocal(eventStagePoint).x, canvas.globalToLocal(eventStagePoint).y);       
              // CUT
    /** END OF MOUSE WHEEL LISTENER  */
             * Scales the matrix through affine transformation.
            public static function scaleAt(sprite:Sprite, scaleX:Number, scaleY:Number, originX:Number, originY:Number):void
                var translateMatrix:Matrix = sprite.transform.matrix;
                // move to origo to preserve form
                translateMatrix.translate(-originX, -originY);
                // scale the matrix
                translateMatrix.scale(scaleX, scaleY);
                // move back to originX, originY
                translateMatrix.translate(originX, originY);
                sprite.transform.matrix = translateMatrix;
    This scales the maskCanvas also. Next I'm trying to scale the maskCanvas back to it's original position by:
              MatrixHelper.scaleAt(maskCanvas, (1 / zoomIn), (1 / zoomIn), maskCanvas.globalToLocal(eventStagePoint).x * (1 / zoomIn), maskCanvas.globalToLocal(eventStagePoint).y * (1 / zoomIn));
    The problem is that when the Canvas is scaled, the mask  changes it's position when I try to scale it back to it's original size and position (as it's size and position changed when dragCanvas was scaled because maskCanvas is a child of dragCanvas).
    This might not be the best way to achieve scrolling. I also thought about extending Canvas and creating a parent Canvas that would contain dragCanvas and maskCanvas as it's children. That way scaling one would not affect the other. The problem with this was that I didn't find a way to do that without overriding Canvas functionality. If anyone knows and could explain how this could be done effectively for example by "decorating" it would be great.
    I would really appreciate if anyone could help me with this. I've struggled with it for quite a few hours already.
    I know I haven't explained everything clearly, so, please, ask me to clarify things more, if this was not understandable.
    Message was edited by: Kimmo Jokinen
    Message was edited by: Kimmo Jokinen

    OK, I found a hacky solution to my problem by going through every rawChildren of the canvas and then scaling it if it's id didn't match with the one I created in the mouseControl component.
    This does not seem like a very elegant way but at least it works.
    I'm pretty sure that this should be done whole differently architecturally but I'm not experienced enough to find that way.
    So this is how I did it.
    for (i = 0; i < canvas.rawChildren.numChildren; i++) {
         child = canvas.rawChildren.getChildAt(i) as Object;
         if (!child is DisplayObject) {
              continue;
         transformAllowed = false;
         displayChild = DisplayObject(child);
         if (displayChild.hasOwnProperty("id") && (displayChild["id"] == "maskCanvas" || displayChild["id"] == "mouseControlArea")) {    
              transformAllowed = false;                                   
         } else {
              transformAllowed = true;
         if (transformAllowed) {
              MatrixHelper.scaleAt(displayChild, zoomOut, zoomOut, canvas.globalToLocal(eventStagePoint).x, canvas.globalToLocal(eventStagePoint).y);

  • Matrix of Cells

    If I want to write a program that displays a matrix of cells that allow a user to toggle the cells on and off (this matrix of cell is really a representation of a grid system), what class and/or interface in Java is available to implement this? There is about 24 x 24 cells. Thanks for your help.

    I do need to record all the cells that are toggled
    and save them to a file so they can be redrawn.
    So is that still an applet? Depends on where do you want to save the file. If it's on the local machine, it is possible but not very easy. It's easier to save files on the server from which the applet originates.
    I can see a simple approach: You have only one component written for the grid. The grid has an array of integers (like int[][] cellState) that holds the state of each "cell" (like 0="not selected", 1="selected", 2=...). The component listens to mouse events, so that it can know when the user has clicked on it and can react to it by figuring out on which cell the user clicked and updating that cell's state. Not very OO, but it works...
    You can start this component can be built on eg. java.awt.Canvas (eg. "public class MapGrid extends Canvas"). The methods you'll need to override for drawing something on the comp. is paint (or update). To receive the mouse clicks you'll need to implement the interface java.awt.event.MouseListener. Try first something simple, like catching the click and drawing something on the canvas on the point where the user clicked.

  • Render the best quality text on the javafx.scene.canvas.Canvas

    I try to draw a text on the canvas, but it looks ugly :( I used canvas because I need a matrix or a grid whose cells contain updated text of different styles. Text updates very often! Maybe some one knew another way of how to do this? Some explanations of the problem:
    Draw the grid whose cells update very often while scroll in some direction.
    Text should have the best quality (with a different styles).
    Memory saving.
    Thanks in advance.

    Stan nailed it, encode direct to MPEG-2 DVD from Premiere, using Media Encoder. However, in regards to the current render looking bad, your source is 16:9 but it looks like it is being encoded as 4:3 and that could have some negative effect. So choose the "MPEG-2 DVD" format, and then the appropriate preset, such as "NTSC Widescreen Progressive" to create the assets to import into Encore an make sure to keep it all 16:9 throughout the workflow
    Thanks
    Jeff Pulera
    Safe Harbor Computers

  • Compute transform matrix for perspective transform

    Hello,
    I have the following problem:
    I have the coordinates of a quadrilateral in an image. Furthermore I have the coordinates of the same quadrilateral but from another perspective. Now I'm seeking a way to compute a transform matrix that transforms the second perspective to the first one, so that both quadrilateral have the same coordinates again.
    Unfortunately I'm not very experienced in Image manipulation and I just discovered the JAI API today. I figured out that there is the class PerspectiveTransform to do transforms with a given transform Matrix, but i wasn't able to find out how I can compute this matrix. Is there maybe an easy way to solve my problem with the help of JAI?

    I mean mx.core.UIComponent (AS 3.4)
    I use it in my .mxml as a generic container
    maybe I should draw on a Canvas instead ?
    part of mxml :
    <mx:UIComponent width="100%" height="100%" id="drawing_surface" />
    thx for help

  • Xml matrix report not expending horizontally

    hi guys m trying to develop xml matrix report but m totally stuck.value are not expanding vertically.
    RTF tags are here.Plz tell me how can i attach rtf and xml file with this post so you people can help me in better way.
    plz help me its very urgent
    <?for-each:G_1?>
    <?ITEM_CATEGORY?>
    Organization : <?horizontal-break-table:1?>
    <?for-each-group@cell: G_ITEM_CATEGORY; ORGANIZATION_CODE?>
    <? ORGANIZATION_CODE?>
    <?end for-each-group?>
    <?for-each-group: G_ITEM_CATEGORY;ITEM_CODE?> <?ITEM_CODE?>
    <?for-each-group@cell:current-group();ORGANIZATION_CODE ?>
    <?current-group()// AMOUNT?>
    <?end for-each-group?>
    <?end for-each-group?>
    <?end for-each-group?>

    When you say "the values are not expanding vertically" do you mean that on the printed report it is not returning all the values for a given field, i.e. the field is too small to display the entire value.... OR the repeating frame for the group is not expanding enough to display all the fields???

  • SSRS 2008 - Expression for totals in a Matrix

    Hi,
    I have a simple Matrix with the following groups:
    Row Group: Program
    Column Group: Employee
    I need to add a new total column on the right side of the matrix using a simple calculation but I haven't been able to find how to do that other than doing it on the query side. Here's how the Matrix looks like:
    Program
    Employee1
    Employee2
    Employee3
    New Column
    Program1
    45.0%
    0.0%
    87.5%
    Program2
    12.5%
    50.0%
    3.8%
    Program3
    28.8%
    1.3%
    8.7%
    Program4
    1.3%
    23.8%
    0.0%
    Total
    87.6%
    75.1%
    100.0%
    The new column should display the sum of each program divided by the sum of all totals....for example for Program1 the calculation should be (45+0+87.5)/(87.6+75.1+100) which should be equal 50.44% ...the same logic applies for the other
    rows.
    The number of columns (Employees) and rows (Programs) are dynamic, so they change according to who is seeing the report. I'm unable to reference the sum of the total at the bottom row, not sure what I am missing.
    Any input on this is greatly appreciated.

    Hi Cleber,
    I have tested on my local environment and your issue can be caused by you haven't include the scope in the sum function, please find details information below about how to do the calculation:
    Please design the matrix like below:
    You can find the Row Group name is "Program" and the Column Group name is "Empolyee", this will include in the sum expression as below:
    Expression1: =SUM(Fields!Amount.Value,"Empolyee")
    Expression2: =SUM(Fields!Amount.Value,"Program")
    Expression2: =Sum(Fields!Amount.Value,"Program")/Sum(Fields!Amount.Value,"DataSet1")
    Preview you will got the result like below:
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • SSRS Matrix report. Variance expression by Month. Need to compare month from prior year to current month of current year VS2010

    Please help.  I have a matrix report.  In the report I have row group  PO Type.  One the Column groups I have a parent group by Fiscal Year, and then a child group by Month.  When I run the report, I get two years of data back broken
    out by month.  Please see below.
    Now here is where I am getting stuck.  I need to take the variance between the current month of the current year, from the same month of the prior year.  So I need to show the difference between Oct , 2014 from Oct, 2013. November, 2014 from November
    2013... etc. etc.
    In the example below, how do I create a column or row showing the variance for Contracts for October 2014.  I need to take the contracts for October 2014 which is 3 and subtract that from October 2013 which is 8.  Any suggestions? How do I do that
    for each month?  Then I need to do it for the quarter... then the year?  But I'll be happy if I can just get the month working first.
    Any help will be appreciated. 
    here is what my rdl file looks like.
    Here is what my report looks like when I render it.

    Hi Adrian_s2012,
    According to your description, you want to compare values for the month of current year with the month of prior year and get the variance. Right?
    In Reporting Services, we don't have any function to get this "Year to Year" Growth. In this scenario, if you data source is a cube, we suggest you use Analysis Services to achieve your requirement. If this data source is just from database, it will be hardly
    to calculate the variance because we need to compare the values within every two different column group and matrix generate adjacent columns one by one. Even we make it by using custom, every time executing the long code when generating result
    in a cell will reduce a lot of performance, we really don't suggest to do that in SSRS. Here is a thread with much easier requirement, please take a reference of that:
    http://social.msdn.microsoft.com/Forums/office/en-US/842e2dcb-d949-4297-9d91-eac989692cb5/difference-between-the-grouped-column?forum=sqlreportingservices
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • SSRS - Expression to color column value dynamically in Matrix

    Hi ,
    I have a matrix which looks like :
    The <<Expr>> value can be 1 /0 /"-" .
    The Expr value is being calculated dynamically.
    The data set query I am using has a column called due_days.
    In the color expression of the <<Exp>> box I am using the expression as :
    =IIf(Fields!Due_Days.Value>14  and Fields!Notes_Count.Value>0,"Blue",(Iif(Sum(Fields!Notes_Count.Value)=0 ,"Red","Black")))
    My requirement is if the Due_Days column value is >14 then I need to highlight the value as blue else black and if value is 0 then red. When I use the above query it is just highlighting the color blue for 1st column only. Eg: 4th row . Due days for month
    of Oct and Nov is > 14 but it shows blue only for month of oct.
    How can i resolve the issue?

    In select query i have 5 columns:
    Due days(Which is difference between 2 dates) ,
    Notes count (Which is just a count of notes  entered or not having value 0/1  and value '-' if another column CRD is greater than the matrix month and year.)Eg: below date 11/12/2014 is greater than Oct 2014 hence Oct 2014 should have "-"
    Month Name , Year , Month Nbr (last 6 months which I cross joined with the table to get counts for each month)
    The matrix has year and last 6 month  as column groups
    Color coding should be if notes count is 0 then red  ,if notes count is 1 and due_days> 14 then blue else black . When i try to use expression for color as i mentioned above, it colors only 1st colum.eg:  2nd row
    Nov 2014 is blue but for jan 2014 also it should show blue as due days>14 .
    Is there any way i can do that ??
    Eg: data set returns value as :
    Due Days        CRD                              Month         
    Month_Nbr    Year   Notes _Count
    5             2014-11-28 00:00:00.000    December          12         2014       
    0
    5               2014-11-28 00:00:00.000    February           2         2015        
    0
    5             2014-11-28 00:00:00.000    January              1           2015      
    0
    5            2014-11-28 00:00:00.000    November          11          2014       1
    5            2014-11-28 00:00:00.000    October              10          2014        0
    5            2014-11-28 00:00:00.000    September          9           2014         0
    Matrix is of the form :
                  YEAR
                  MONTH
    CRD        Notes_count

  • How to Delete a Specific Cell in a Matrix + plz Give sample code for Lost F

    hello there !!!!
    i m in Great Trouble please help me out..
    i have to search for a specific Column n then i have to validate that portion, similarly after validating i have to add update delete all the fuction apply... so please help me i m very upset.
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim Count As Int32
                If FormUID.Equals("Allowance") Then
                    If (pVal.BeforeAction = True) And (pVal.ItemUID = "1") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                        If pVal.Row = 0 Then
                            'BubbleEvent = False
                        End If
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        Count = o_Matrix.RowCount()
                        SBO_Application1.MessageBox("Matrix Count is " & o_Matrix.RowCount)
                        Validate(pVal, EventEnum, FormUID, BubbleEvent)
                    End If
                End If
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
        Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim Row, ii As Integer
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            o_Matrix.FlushToDataSource()
            Try
                For Row = 2 To o_Matrix.RowCount
                    StrName = Convert.ToString(DBtable.GetValue("CardCode", Row - 1)).Trim()''' i got Error over there n rest of my code is also not working pls...
                    StrUId = Convert.ToString(DBtable.GetValue("U_AlwID", Row - 1)).Trim()
                    StrEnter = Convert.ToString(DBtable.GetValue("U_SupEnter", Row - 1)).Trim()
                    StrExist = Convert.ToString(DBtable.GetValue("U_SupExist", Row - 1)).Trim()
                    If Row - 1 < DBtable.Rows.Count - 1 Or (Not (StrName.Equals(String.Empty) And StrUId.Equals(String.Empty) And (StrEnter.Equals(String.Empty) Or StrExist.Equals(String.Empty))) And (Row - 1 = DBtable.Rows.Count - 1)) Then
                        If (Not StrName.Equals(String.Empty)) And ((StrUId.Equals(String.Empty) Or StrEnter.Equals(String.Empty)) Or StrExist.Trim.Equals(String.Empty)) Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                        For ii = Row To DBtable.Rows.Count - 1
                            If Convert.ToString(DBtable.GetValue("ColName", ii)).Trim().Equals(StrName.Trim()) Then
                                SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Duplication Not Allowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                                oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                                BubbleEvent = False
                                Exit Sub
                            End If
                        Next
                        If CDbl(StrName) < 0 Then
                            SBO_Application1.StatusBar.SetText("Invalid values provided!Blank values not vllowed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            BubbleEvent = False
                            Exit Sub
                        End If
                    End If
                Next Row
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

    Hello there
    sir i want to Add Update and delete these three basic operation onto the Matrix, Sir u game me a Sample code of Delete a specific Column...
    Sir can u do me a favour pls leave every thing n just told me how to update a matrix ,like i have to fill the matrix field through the DATABASE table now i want to update the DataBase table from the matrix..
    i just only know thta i have to fill back database table with the help of FLUSHTODATABASE()
    here is my Sample Code...n i have to update in the validate portion...
    Public Sub HandleEventts_Allowance(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByRef BubbleEvent As Boolean)
            Try
                Dim oCellValue As SAPbouiCOM.EditText
                If FormUID.Equals("Allowance") Then
                    If (pVal.ItemUID = "MatAllow") Then
                        If pVal.Row = 0 Then Exit Sub
                        o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                        If (pVal.Row > o_Matrix.RowCount) Then Exit Sub
                        oForm = SBO_Application1.Forms.Item(FormUID)
                        If (pVal.ItemUID = "1" Or EventEnum = SAPbouiCOM.BoEventTypes.et_CLICK) Then
                            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
                            If pVal.ColUID = "ColName" And pVal.BeforeAction = True Then
                                If pVal.Row = 0 Then Exit Sub
                                oCellValue = CType(o_Matrix.Columns.Item(pVal.ColUID).Cells.Item(pVal.Row).Specific(), SAPbouiCOM.EditText)
                                If (oCellValue.Value.Trim().Equals(String.Empty) And o_Matrix.RowCount <> pVal.Row) Then
                                    SBO_Application1.StatusBar.SetText("Invalid Allowance ID: Blank Value Not Allowed", )
                                    oCellValue.Active = True
                                    BubbleEvent = False
                                    Exit Sub
                                End If
                            End If
                        End If
                    End If
                End If
                Validate(pVal, EventEnum, FormUID, BubbleEvent)
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub
    Public Sub Validate(ByRef pval As SAPbouiCOM.ItemEvent, ByRef EventEnum As SAPbouiCOM.BoEventTypes, ByVal FormUID As String, ByRef BubbleEvent As Boolean)
            Dim str, str1 As String
            Dim checkbox1, Checkbox2 As SAPbouiCOM.CheckBox
            Dim o_Matrix As SAPbouiCOM.Matrix
            Dim Sum As Integer
            Dim oRecordset As SAPbobsCOM.Recordset
            Dim Container As Integer
            Dim Count As Int32
            o_Matrix = SBO_Application1.Forms.Item(FormUID).Items.Item("MatAllow").Specific
            oRecordset = o_CompanyObj.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            Try
                For Count = 0 To DBtable.Rows.Count - 1
                    CodeFill = Convert.ToString(DBtable.GetValue("Name", Count).Trme())
                    NameID = Convert.ToString(DBtable.GetValue("ColUID", Count).Trim())
                    Price = Convert.ToString(DBtable.GetValue("ColPrice", Count).Trim())
                    Quantity = Convert.ToString(DBtable.GetValue("ColQuant", Count).Trim())
                    Total = Convert.ToString(DBtable.GetValue("ColTotal", Count).Trim())
                    checkbox1 = o_Matrix.Columns.Item("ColSEnter").Cells.Item(Count).Specific
                    Checkbox2 = o_Matrix.Columns.Item("ColSExist").Cells.Item(Count).Specific
                    If (checkbox1.Checked = True) And (Checkbox2.Checked = True) Then
                        Dim Sql As String
                        Sql = "Update [@Supplier] Set U_Price=' " & Price & " ',U_ID=" & NameID & "Where Name ='" & CodeFill & " '"
                        oRecordset.DoQuery(Sql)
                    End If
                Next Count
                SBO_Application1.MessageBox("Record was Updated")
            Catch ex As Exception
                SBO_Application1.MessageBox(ex.Message)
            End Try
        End Sub

  • Display image in full screen canvas

    Hi frndz
    I have an Image, which either bigger in size of a canvas or small
    I want to give an option of a full screen view
    So its a kind of zoomIn/ zoomOut function in one method
    how can I convert such small/big images into full screen canvas size
    thanks
    alpesh

    This question has been asked already several times here: http://onesearch.sun.com/search/onesearch/index.jsp?qt=resizing+image&subCat=siteforumid%3Ajava76&site=dev&dftab=siteforumid%3Ajava76&chooseCat=javaall&col=developer-forums
    There is no method in MIDP which rescales a picture for you, so you have to write it on your on (or use existing code). But usually this would be pretty slow. Mostly it is better to offer different versions of your application for different devices (screen resolutions) where the images have already the appropriate size within your jar-file.

Maybe you are looking for

  • Frustrated with the lack of Support and Attention to the Thunderbolt

    I was under the impression when I upgraded to the TB, that it was/is the "Flagship" for 4g Android phones (at least it was back in March).  Unfortunately, that's not the case and I should of kept my Droid X a little longer.  Although the Droid X is n

  • HT5271 Adobe flash 11.2 install but Safari 5.1.7 not loading pages

    I'm very frustrated after spending an hour looking into why, once installing updates, Sarfari no longer loads pages.  I have the most current version of Adobe Flash, so that should not be an issue. 

  • Ticker - link to jump to new dashboard

    I know how to create a table and be able to click on a column, and have it direct you to a new dashboard and pass the column. Now I'm trying to do the same with the Ticker. I want to click on the ticker and be taken to the same dashboard the table ta

  • SharePoint 2007 Auto Complete on Drop Down

    Hi is it possible to have a auto complete function for a drop down menu? Example is I have this Genre column options are Pop, Pop-Rock, Jazz and Rock. What I want to achieve is having to click the drop down menu can I just type "Pop" and will leave m

  • Has anyone else lost Netflix from the Internet menu?

    I have done restarts, reboots, signed in and out and in of AirPlay, homeshare, etc... I have been on the Netflix site, no problems there. Has it just dropped from the menu for anybody else? I can't find any outage information on the web.