Bonjour,

Je cherche a afficher une image qui se trouve dans la base de donnée.
Le champ est un blob.

Je vais comme cela mais rien ne s'afiche :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
    imgView.image = [UIImage imageWithData:item.image];
    
    UIGraphicsBeginImageContextWithOptions(imgView.bounds.size, NO, 1.0);
    
    [[UIBezierPath bezierPathWithRoundedRect:imgView.bounds
                                cornerRadius:20.0] addClip];
    [imgView.image drawInRect:imgView.bounds];
    
    imgView.image = UIGraphicsGetImageFromCurrentImageContext();
    
    UIGraphicsEndImageContext();
    
    NSData *rawImageData = [NSData dataWithData:item.image];
    UIImage *img = [UIImage imageWithData:rawImageData];
    
    myCell.imageView.image = img;
une idée ?

Merci