Problem with a method to modify the transparency of a Label UILabel

HI
I Have create a small project which can modify the brightness ( or the transparency ) of a label
UIlabel
So the code
File .m
ControlBoxCookeAppDelegate.m
Code :
Code:
*// ControlBoxCookeAppDelegate.m*
*// Control Box Cooke*
*// Created by Bruno on 1/11/10.*
*// Copyright _MyCompanyName_ 2010. All rights reserved.*
*#import "SerialManager.h"*
*#import "ControlBoxCookeAppDelegate.h"*
*#import "PickerViewController.h"*
*#include <fcntl.h>*
*#include "Led.h"*
*@implementation ControlBoxCookeAppDelegate*
*@synthesize window;*
*- (void)applicationDidFinishLaunching:(UIApplication *)application {*
*// Override point for customization after application launch*
*[window makeKeyAndVisible];*
//RootViewController.m
*- (void)applicationDidFinishLaunching:(UIApplication *)application {*
* pvController = [[PickerViewController alloc] initWithNibName:@"pickerview"/@"MainWindow"*//@"Control Box Cooke"//*@"PickerView"/ bundle:[NSBundle mainBundle]];*
* Led_Operateur= [[Led alloc] initWithFrame:CGRectMake(20,50,280,20)];*
* Led_Operateur.text=@" ";*
* [Led_Operateur setBackgroundColor: [ UIColor colorWithWhite:1.0 alpha: 0.5]];*
* [pvController.view addSubview:Led_Operateur];*
* [window addSubview:pvController.view];*
* // Override point for customization after application launch*
* [window makeKeyAndVisible];*
*- (void)dealloc {*
* [Led_Operateur release];*
* [pvController release];*
*[window release];*
*[super dealloc];*
-(void)Modifie_luma:(CGFloat)luma
* pvController = [[PickerViewController alloc] initWithNibName:@"pickerview" bundle:[NSBundle mainBundle]];*
* Led_Operateur= [[UILabel alloc] initWithFrame:CGRectMake(20,50,280,20)];*
* Led_Operateur.text=@" ";*
* [Led_Operateur setBackgroundColor: [ UIColor colorWithWhite:1.0 alpha: luma]];*
* [pvController.view addSubview:Led_Operateur];*
* [window addSubview:pvController.view];*
* [window makeKeyAndVisible];*
@end
file.h
Code :
Code:
*// ControlBoxCookeAppDelegate.h*
*// Control Box Cooke*
*// Created by Bruno on 1/11/10.*
*// Copyright _MyCompanyName_ 2010. All rights reserved.*
*#import <UIKit/UIKit.h>*
*#import "SerialManager.h"*
*#import "led.h"*
*@class PickerViewController;*
*@interface ControlBoxCookeAppDelegate : NSObject <UIApplicationDelegate> {*
*UIWindow window;
* PickerViewController pvController;
* SerialManager portCunima;
* int portin,portout; // numero de port de com in-out*
* UILabel Led_Operateur;
-(void)Modifie_luma:(CGFloat)luma;
*@property (nonatomic, retain) IBOutlet UIWindow window;
@end
To the initialization no problem my label UILabel display itself very well with the transparency
of 50% ( alpha=0.5)
But when I modify this transparency with a button, in my window iPhone
the program call the method Modifie_Luma witch is the class
ControlBoxCookeAppDelegate
the program go on to this method, (I have fixe a breakpoint) but impossible to various this transparency.
So if I change in method (void)applicationDidFinishLaunching
the transparency
example alpha =0,5 => alpha =0,8
Code :
Code:
* [Led_Operateur setBackgroundColor: [ UIColor colorWithWhite:1.0 alpha: 0.8]];*
this example go on
resume
when I change the transparency in the method
(void)applicationDidFinishLaunching it 's OK
when I change the transparency in the method
-(void)Modifie_luma it's not OK
Have you an explanation ?

So the code , sorry but no marker for the code in post
How do you do ?
// ControlBoxCookeAppDelegate.h
// Control Box Cooke
// Created by Bruno on 1/11/10.
// Copyright _MyCompanyName_ 2010. All rights reserved.
#import <UIKit/UIKit.h>
#import "SerialManager.h"
#import "led.h"
@class PickerViewController;
@interface ControlBoxCookeAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
PickerViewController *pvController;
SerialManager *portCunima;
int portin,portout; // numero de port de com in-out
UILabel *Led_Operateur;
-(void)Modifie_luma:(CGFloat)luma;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end
// ControlBoxCookeAppDelegate.m
// Control Box Cooke
// Created by Bruno on 1/11/10.
// Copyright _MyCompanyName_ 2010. All rights reserved.
#import "SerialManager.h"
#import "ControlBoxCookeAppDelegate.h"
#import "PickerViewController.h"
#include <fcntl.h>
#include "Led.h"
@implementation ControlBoxCookeAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after application launch
[window makeKeyAndVisible];
//RootViewController.m
- (void)applicationDidFinishLaunching:(UIApplication *)application {
pvController = [[PickerViewController alloc] initWithNibName:@"pickerview"/@"MainWindow"*//@"Control Box Cooke"//*@"PickerView"/ bundle:[NSBundle mainBundle]];
Led_Operateur= [[Led alloc] initWithFrame:CGRectMake(20,50,280,20)];
Led_Operateur.text=@" ";
[Led_Operateur setBackgroundColor: [ UIColor colorWithWhite:1.0 alpha: 0.5]];
[pvController.view addSubview:Led_Operateur];
[window addSubview:pvController.view];
Led *ZoneA;
CGRect Dimension;
ZoneA = [[Led alloc]initWithFrame:Dimension];
[pvController.view addSubview:ZoneA];
[window addSubview:pvController.view];
[ZoneA Modifie_luma:0.5];
[ZoneA release];
// Override point for customization after application launch
[window makeKeyAndVisible];
Led *Led1;
CGRect frame;
Led1=[[Led alloc] initWithFrame:frame];
[pvController.view addSubview:Led1];
[window addSubview:pvController.view];
[Led1 release];
[label release];
[Error_message release];
[path_port release];
- (void)dealloc {
[Led_Operateur release];
[pvController release];
[window release];
[super dealloc];
-(void)Modifie_luma:(CGFloat)luma
pvController = [[PickerViewController alloc] initWithNibName:@"pickerview" bundle:[NSBundle mainBundle]];
Led_Operateur= [[UILabel alloc] initWithFrame:CGRectMake(20,50,280,20)];
Led_Operateur.text=@" ";
[Led_Operateur setBackgroundColor: [ UIColor colorWithWhite:1.0 alpha: luma]];
[pvController.view addSubview:Led_Operateur];
[window addSubview:pvController.view];
[window makeKeyAndVisible];
@end

Similar Messages

  • Problem with lower third template & modifying the text...

    I'm doing a top 10 type video, & I downloaded this lower third template & I had never used AE before; I figured out how to duplicate it multiple times through the video where appropriate... but when I modify the text on one template it does the same thing to all of them. How do I make them all separate?

    Ok, think about what you have done to change the text for moment. You drilled down to a pre-comp or nested comp that contains a text layer. This makes perfect sense. Unfortunately that text pre-comp is also nested in a pre-comp. This means you need to find each of these pre-comps in your project panel and duplicate them there, open the duplicates and then change the text in the duplicates, then replace the original nested comps in the main comp.
    I have another observation on your workflow. You've put a bunch of shots and transitions in a single comp which, in effect, tells me that you are using AE as a NLE (editing app). What I would have done is to put every one of your shots that you want to add titles to in a separate comp to simplify each comp. I'd then edit them in a NLE....
    The other way I would do this project is to make a comp that is just the needed titles, one comp for each tltle overlay, render the titles with alpha channels, then bring the titles and the original footage into a NLE to edit and add titles.
    Building extremely complex compositions with multiple shots in a single comp is usually not a very good idea, even for folks like me that have been doing AE for 20 years. AE is perfect at making shots, lousy at editing sequences so always, and I mean always, try to figure out how you can simplify your project to it's basic elements and build a comp on that. I've had 5 second animations with over a hundred layers, but I've never put 10 or 20 video clips in AE in a single comp and tried to create a sequence.

  • I've a problem with my account , mainly in the payment method " security code is invalid" this the current situation wgat can i do ???

    I've a problem with my account , mainly in the payment method " security code is invalid" this the current situation what can i do ???

    you need to update your payment information to insert the correct security code.
    http://support.apple.com/kb/ht1918

  • I have problem with pay method

    I have problem with pay method. My card declined. I change card and I have the same problem. What can i do? Why declined my card again?

    Contact iTunes store support: https://ssl.apple.com/emea/support/itunes/contact.html.

  • Problem with traverse method

    Hi, I am having this problem:
    I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
    The problem is that when I press the left or rigth button it also returns false and not true.
    and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
    protected void paint(Graphics g, int ancho, int alto) {
              System.out.println ("Dentro del paint, seleccionado="+seleccionado);
              try {
                   g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
                   if (!seleccionado) {
                        g.setColor(120, 120, 120);
                   g.drawRect(0, 4, tama�oTexto+8, 25);
                   if (seleccionado) {
                        g.setColor(255, 255, 255);
                        g.fillRect(1, 5, (tama�oTexto+8-1), 23);
                   g.setColor(0, 0, 0);
                   if (!seleccionado) {
                        g.setColor(80, 80, 80);
                   g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
                   if (seleccionado) {
                        int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
                        g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
              } catch (Exception E){
                   E.printStackTrace();
         }the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).

    I have a problem with findByxxx() method.. in
    Container managed bean.
    i have
    Collection collection =
    home.findByOwnerName("fieldValue");
    specified in my Client Program, where ownerName is the
    cmp fieldname..
    and
    public Collection findByOwnerName(String ownerName)
    throws RemoteException, FinderException
    defined in my home interface.
    i have not mentioned the findBy() method anywhere else
    (Bean class). You have to describe the query in the deployment descriptor.
    >
    Even if i have a same "fieldValue" in the database
    (Oracle), which i specified in findBy() method, iam a
    result of owner Not found, which is not the case as i
    have that owner name.
    for the same application if i use findByPrimaryKey(),
    it is working..
    Can any one please post me the solution.

  • Problem with GetLineData Method

    Hi
    I have a program to save each row of a A/R Invoice as one A/R Invoice document.
    In the program, I read each line of data from matrix with GetLineData Method, and set the data to business object, and add the document at a global transaction.
    Adding the first line of document works fine, but the second line has a problem. There is no response in the  the GetLineData Method.
    Does anybody have any idea?
    The code looks like the following:
    Private Sub MakeSalesInvoice(ByRef BubbleEvent As Boolean)
         Dim i As Integer                                             
           Try
                If Not (SBO_COMPANY.InTransaction) Then
                    Call SBO_COMPANY.StartTransaction()
                End If
                oMatrix = oForm.Items.Item("38").Specific                 
                For i = 1 To oMatrix.RowCount - 1
                    oMatrix.GetLineData(i)                //here, there is no response when i >=2
                    subSetInvoiceH()
                    subSetInvoiceL()
                    If InvoiceH.Add() <> 0 Then
                       Exit Sub
                    End If
                    InvoiceH = Nothing
                    InvoiceL = Nothing
                    InvoiceLA = Nothing
                Next
                If SBO_COMPANY.InTransaction Then
                    SBO_COMPANY.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
                End If
                BubbleEvent = False
                oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
                oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
            Catch ex As Exception
                If SBO_COMPANY.InTransaction Then
                    SBO_COMPANY.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                End If
            End Try
       End Sub
       Private Sub subSetInvoiceH()
       //code to set A/R Invoice header data to SAPbobsCOM.Documents
       End Sub
       Private Sub subSetInvoiceL()
      //code to set A/R Invoice line data to SAPbobsCOM.Documents_Lines
       End Sub
    Can someone help me?
    Thanks in advance.

    Thanks for the response.
    I tried GetLineData(i-1), but got error "Row - Invalid index" message.
    I think the index of the datasource has no problem in my program since i set -1 when i get the data from datasource.
    The following is the code when setting data to the business objects.
    Private Sub subSetInvoiceH()
            Dim nCount As Integer
            Dim oDBDataSource As SAPbouiCOM.DBDataSource
            oDBDataSource = oDBDataSources.Item("OINV")
            nCount = oDBDataSource.Size - 1
            InvoiceH = SBO_COMPANY.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            With InvoiceH
                If oDBDataSource.GetValue("CardCode", nCount) <> "" Then
                    .CardCode = oDBDataSource.GetValue("CardCode", nCount)
                Else
                    .CardCode = ""
                End If
                If oDBDataSource.GetValue("DocDate", nCount) <> "" Then
                    .DocDate = oDBDataSource.GetValue("DocDate", nCount).Insert(4, "/").Insert(7, "/")
                Else
                    .DocDate = "0"
                End If
            End With
        End Sub
    Mika

  • Problem with affinetransformOp method...

    I have a serious problem with filter method
    I Want to make a image flipping or some other filtering by using
    AffineTransformOp
    but it printouts an erro like this
    cannot resolve symbol
    op.filter (img, flipped)
    (the error pointer shows ".after the op")
    a code from my one of the filters
    BufferedImage flipped = new BufferedImage(img.getHeight(), img.getWidth(),BufferedImage.TYPE_INT_RGB);
    AffineTransform trans = new AffineTransform(0, 1, 1, 0, 0, 0);
    AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    op.filter(img, flipped); //img is my buffered image source
    I used some other ways like (img, null) but always give out error.
    thanks..

    Did you declare "img" as BufferedImage or something else?
    What is the full error message?

  • Problem with WindowClosing() method

    Hello everyone,
    I have some problem with WindowClosing() method, in which I gave options
    to quit or not. Quit is working fine but in case of Cancel, its not returning to
    the frame. Can anyone help me ....Here is my code
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    public class TestFrame extends JPanel
         public static void main(String[] args)
              JFrame frame = new JFrame("Frame3");
              WindowListener l = new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        int button = JOptionPane.showConfirmDialog(null,"OK to Quit","",JOptionPane.YES_NO_OPTION, -1);
                        if(button == 0)     {
                             System.exit(0);
                                   else
                                              return;
              frame.addWindowListener(l);
              frame.setSize(1200,950);     
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }

    Maybe try
    int button = JOptionPane.showConfirmDialog(yourframe,"OK to
    Quit","",JOptionPane.YES_NO_OPTION, -1);

  • I'm having problems with videos, they shake and the images break up back and forth into striped colors, how do I fix this?

    I'm having problems with videos, they shake and the images break up back and forth into striped colors, how do I fix this?

    1) This is because of software version 1.1. See this
    thread for some options as to how to go back to 1.0,
    which will correct the problem...
    http://discussions.apple.com/thread.jspa?threadID=3754
    59&tstart=0
    2) This tends to happen after videos. Give the iPod a
    minute or two to readjust. It should now be more
    accurate.
    3) This?
    iPod shows a folder icon with exclamation
    point
    4) Restore the iPod
    5) Try these...
    iPod Only Shows An Apple Logo and Will Not Start
    Up
    iPod Only Shows An Apple Logo
    I think 3,4, and 5 are related. Try the options I
    posted for each one.
    btabz
    I just noticed that one of the restore methods you posted was to put it into Disk Mode First rather than just use the resstore straight off, I Have tried that and seems to have solved the problem, If it has thank you. previously I have only tried just restoring it skipping this extra step. Hope my iPod stays healthy, if it doesnt its a warrenty job me thinks any way thanks again

  • Is anyone experiencing problems with opening mission control from the desktop.  Running mountain lion with parallels 7 and windows 7

    is anyone experiencing problems with opening mission control from the desktop.  Running mountain lion with parallels 7 and windows 7

    I had been having a similar problem on Lion with Safari pdf files despite downloading the latest Adobe Reader XI.
    I would constantly get the same messages - There was an error opening this document. The file is damaged and could not be repaired. And I would get a blank page when I tried to print the pdf if I tried printing from the Safari web page using File - Print from the top toolbar on my laptop.
    Then I came across the grey Safari lozenge with action icons.
    This allowed me, without downloading the pdf, to print the pdf file direct from the Safari page by using the Print icon on the grey lozenge that appears centrally three quarters down the screen.
    Then I discovered that if I save the pdf using the Save icon from this same grey lozenge on the Safari page I can open and print this pdf version from my desktop.
    I've tested it with a couple of different pdf files and these methods work using the grey lozenge icons but the same pdfs files don't work using File - Save As on the Tool Bar.

  • I am having problem with me Iphone4, looks like the mic of my phone is not working. no one can hear me if I make a call to them

    Can any one please help me I am having problem with me Iphone4, looks like the mic of my phone is not working. no one can hear me if I make a call to them. I have tried all restoring options but no use. please help me

    The mic on my iPhone4 has just quit also. Similar symptoms to yours in that people I'm talking to hear only static or my voice very faintly. The voice/memo recorder also only really records static.
    It happened suddenly and seemed to get better after a day or two but then went completely after another day.
    I'm returning it to Vodafone New Zealand shortly but will have to wait 5-10 days for a replacement. There are NO Apple accredited means to speed this procedure up in NZ.
    We don't even have a single physical Apple Store where you could walk in and talk to a Genius.

  • Hello I have a problem with my ipod touch 1G the problem is that see me key to the floor! And when recogi not prendia after 5 minutes prendio but it gave to me the surprise of which the battery had finished completely! What I did was to set it to load wit

    Hello I have a problem with my ipod touch 1G the problem is that see me key to the floor! And when recogi not prendia after 5 minutes prendio but it gave to me the surprise of which the battery had finished completely! What I did was to set it to load with the USB but do not load the battery me the icon of the battery appear and below of her the beam that indicates that this being loaded but this way I have left it the whole yesterday and what goes of today and continues without loading anything! They can help me porfavor I am grateful for them to him very much!   And my PC does not detect it not itunes

    Try the not-charging topic of:
    iPod touch: Hardware troubleshooting
    It could be that the battery is dead.

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • I have a problem with my MacBook Pro is the almost of my app not working at all like a app store and terminal and other important apps please if u can help me as fast as you can cuz i don't wanna format it that's why am on Mac now not win ?

    i have a problem with my MacBook Pro is the almost of my app not working at all like a app store and terminal and other important apps please if u can help me as fast as you can cuz i don't wanna format it that's why am on Mac now not win ?

    Abdussalam.A,
    you mentioned that Terminal does not work at all for your MacBook Pro. What currently happens when you run Terminal? In what way does it not work?

  • Hiya, I've got a weird problem with my iPhone4. On the 'home page' of my iPhone the mail symbol tells me there's a new mail waiting for me. However, there's no new mail to be found. Does anyone know what the problem is? Thanks

    Hiya, I've got a weird problem with my iPhone4. On the 'home page' of my iPhone the mail symbol tells me there's a new mail waiting for me. However, there's no new mail to be found. Does anyone know what the problem is? Thanks

    This response is a little late as I just read about your problem. I have a 2012 Dodge Charger and a 2012 Chrysler Town and Country and both worked flawlessly with the iPhone 5s my wife and I had. However, we just upgraded to the iPhone 6 and Uconnect will receive calls but you cannot answer them. You can callout successfully, however. the annoyance being the inability to answer incoming calls in the HandsFree mode.

Maybe you are looking for

  • Loading Error  - 'JTF ' in  API -'jtf_rs_resource_pub.create_resource'

    Hi , I am working on  Project resource Create conversion , i did the mapping it work fine but while loading i got the error , in the log message RETURN_STATUS= 'E' X_MSG_DATA = 'JTF' I am not able to understand error data that is 'JTF' . Please if so

  • How to store output of SQ01 into internal table.

    Hello Experts How to store output of SQ01 into internal table. Thanks, Umesh

  • Embedding html in $message

    I may be going about this the wrong way but I am trying to automate a report to be sent to a mail recipient. I have created a php page report and then added the attached code to create an e-mail to a specific individual. As you will see, the $message

  • Multiple Data In 1 colum

    Hi All, I get the requirement to print multiple data in 1 row the requirement is as below : Date                  | GL Account                 | Amount       | 010112              | 100000                        | 100.00        | 020212             

  • How to write Vietnames comments by JavaDoc tool in NetBeans IDE

    Hello everybody! I'm software technology programming of Huesoft company of VietNam and I'm researching about JavaDoc tool but I get a problem that I can't write comments and generate doccuments by Vietnames. I only know that I can open the HTML files