Picture question

  1. 6 days ago

    Joost R

    Nov 7 Pre-Release Testers, Xojo Pro The Netherlands

    I have a picture object and can set a backdrop picture and put my own drawings on top of it. Now I would like to have a png-picture (with transparency) to be placed on top of the backdrop picture, in order to get a new picture. Let’s say a nice picture with my graphic logo placed on it. Can anybody give me a hint how to do this ?

    guess I am missing the crux of your question.

    dim p as new picture( .... size....)
    dim g as graphics = p.graphics
    g.drawpicture basepic,0,0
    g.drawpicture overlay,0,0
    g.drawpicture logo, 100,100,logo.width,logo.height, 0,0,logo.width,logo.height

    assuming overlay and logo are masked as required

  2. Markus R

    Nov 7 Pre-Release Testers, Xojo Pro Europe / Germany
    Edited 6 days ago

    so you would replace the picture backdrop propertie with a new picture at runtime?
    u can't draw all in the paint event?

    logo is a picture in the ide.

    Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint
      g.drawPicture(logo,0,0,g.width,g.height,0,0,logo.width,logo.height)
     End Sub
  3. Emile S

    Nov 7 Europe (France, Strasbourg)

    a. You modify your images (whatever they really are: photos, scans, artwork) in offscreen Picture,
    b. You draw them into screen: all in Backdrop or one of them in Backdrop and the other(s) in Paint, so you can watch what you’re doing and same everything in a single (another) Offscreen picture to disk (or print or pdf).

    I hope I recall correctly who is frontmost (.Paint Event ?) and who is Background (Backdrop Property ?).

    Of course, depending on the image size, this may need memory.

  4. Dave S

    Nov 7 Answer San Diego, California USA

    guess I am missing the crux of your question.

    dim p as new picture( .... size....)
    dim g as graphics = p.graphics
    g.drawpicture basepic,0,0
    g.drawpicture overlay,0,0
    g.drawpicture logo, 100,100,logo.width,logo.height, 0,0,logo.width,logo.height

    assuming overlay and logo are masked as required

  5. Joost R

    Nov 7 Pre-Release Testers, Xojo Pro The Netherlands

    @Dave S : so easy. I should have known better. Sometimes a programmer can think just to complicated. Thx.

or Sign Up to reply!