vsDraw DrawImage in VB.net

Posted by: SatishMatani on 12 December 2018, 2:22 am EST

    • Post Options:
    • Link

    Posted 12 December 2018, 2:22 am EST

    Hello,

    I am converting old vb6 programs to vb.net. I am still using old ComponentOne ActiveX component. I am having problem with vsDraw for DrawPicture method.

    In vb6 I have a picturebox called picX with a picture and I use following line which works fine:

    .DrawPicture picX, .X1, 380 - 35, -80, 100

    However, in vb.net following line does not seem to work

    .DrawPicture(picHf, .X1 - 100, 380 - 35, 80, 100)

    It gives an error that the PictureBox cannot be converted to image.

    Note that I would not like to load the picture from a file. I would like to embed picture in my form and use it.

    Any help will be greatly appreciated

  • Posted 12 December 2018, 3:02 am EST

    Figured it out.

    It is .DrawPicture(picX.image, .X1 - 100, 380 - 35, 80, 100)

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels