Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > French Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Remplir une forme avec un bitmap

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-23-2011, 10:28 AM
Junior Member
 
Join Date: May 2007
Posts: 11
Default Remplir une forme avec un bitmap

Bonjour,

existe-t-il un moyen de remplir une forme géométrique simple avec le contenu d'un bitmap? De texturer en quelque sorte.

Merci d'avance pour vos réponse.

LGG
Reply With Quote
  #2 (permalink)  
Old 11-23-2011, 11:04 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

Oui, ci-dessous un code exemple utilisant Canvas.ClipPath:
Code:
Sub Globals
    
Dim Canvas1 As Canvas
End Sub

Sub Activity_Create(FirstTime As Boolean)
    
Dim Path1 As Path
    
Dim bmpTest As Bitmap
    
Dim DestRect As Rect
    
    bmpTest.Initialize(
File.DirAssets, "Rose1.jpg")
    Canvas1.Initialize(Activity)
    DestRect.Initialize(
00100%x100%y)
    
    Path1.Initialize(
50%x100%y)
    Path1.LineTo(
100%x50%y)
    Path1.LineTo(
50%x0%y)
    Path1.LineTo(
0%x50%y)
    Path1.LineTo(
50%x100%y)
    Canvas1.ClipPath(Path1) 
'clip the drawing area to the path.
    
    Canvas1.DrawBitmap(bmpTest, 
Null, DestRect) 'fill the drawing area with the gradient.

    Activity.Invalidate
End Sub
Meilleures salutations.
Attached Images
File Type: jpg DrawPathBitmap.jpg (53.4 KB, 20 views)
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide

Last edited by klaus : 11-23-2011 at 11:18 AM.
Reply With Quote
  #3 (permalink)  
Old 11-23-2011, 11:44 AM
Junior Member
 
Join Date: May 2007
Posts: 11
Default

Formidable!
Un grand merci pour la richesse et le détail de la réponse!
LGG
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conseils pour débuter avec Basic4Android klaus French Forum 0 10-20-2011 11:42 AM
Problème avec Code Module ciginfo Basic4android Updates and Questions 4 09-14-2011 05:40 PM
Bitmap Help Omar Basic4android Updates and Questions 2 06-01-2011 11:19 AM
Besoin d'aide avec Network.dll... sitajony French Forum 2 05-30-2010 09:29 AM
Pb de compilation avec la version 6.03 Dominique French Forum 1 10-03-2008 12:37 PM


All times are GMT. The time now is 06:00 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0