[Gambas-user] Loading pictures

Eric Damron edamron at ...776...
Fri Mar 11 02:55:29 CET 2005


Benoit Minisini wrote:

>On Saturday 05 March 2005 20:33, Eric Damron wrote:
>  
>
>>Can someone send me a snippit showing how to load a picture into the
>>various components that are designed to display them?  I have looked at
>>an example that loads pictures into a drawing area but I must not get it
>>because my own code doens't work.  Also I'm not sure a drawing area is
>>what I really want.  I just want to display jpg pictures of the DVD
>>covers on a DVD database.  My code looks like:
>>
>>PRIVATE SUB SetCover(strPic AS String)
>>
>>  DIM d AS DrawingArea
>>  DIM strS AS String
>>  DIM strPath AS String
>>  DIM hImage AS Image
>>
>>  strPath = GetPicPath()
>>  strS = strPath & strPic
>>
>>  IF Exist(strS) THEN
>>    hImage = NEW Image
>>    hImage.Load(strS)
>>    daCover.Resize(132, 204)
>>    daCover.Clear()
>>    Draw.Begin(daCover)
>>    Draw.FillColor = Color.Gray
>>    Draw.FillStyle = Fill.Solid
>>    Draw.Rect(0, 0, daCover.Width, daCover.Height)
>>    Draw.Image(hImage, 0, 0)
>>    Draw.End
>>    daCover.Visible = TRUE
>>  END IF
>>
>>END
>>
>>Is there a easier / better component to use?
>>
>>Thanks
>>
>>
>>    
>>
>
>The PictureBox control (not component!) should be what you are looking for. Is 
>it ?
>
>Regards,
>
>  
>
Yep, That works.  Thanks!




More information about the User mailing list