How to - vb6 gdimaging to picturebox?
How to - vb6 gdimaging to picturebox?
In vb6 using the com object gdimaging, how do I draw to a picturebox control?
Ultimately I'm trying to transfer the image in a gdimaging object to to the .cellpicture property of a flexgrid control.
Also, is there a way to save the image In the viewer control to gif?
Ultimately I'm trying to transfer the image in a gdimaging object to to the .cellpicture property of a flexgrid control.
Also, is there a way to save the image In the viewer control to gif?
Re: How to - vb6 gdimaging to picturebox?
Something like this should do the trick:
Code: Select all
Dim hBitmap As Long = oGdPictureImaging.GetHBitmap(ImageID)
Set Picture1.Image = imgTest.FromHbitmap(hBitmap)
Re: How to - vb6 gdimaging to picturebox?
I don't see either of these methods with 9.4. I only see:Loïc wrote:Something like this should do the trick:
Code: Select all
Dim hBitmap As Long = oGdPictureImaging.GetHBitmap(ImageID) Set Picture1.Image = imgTest.FromHbitmap(hBitmap)
GetHBitmapFromGdPictureImage
and
CreateGdPictureImageFromHBitmap
Is the example your referring to from an old version?
Re: How to - vb6 gdimaging to picturebox?
These methods dont even exist in the current version .. looks like youve copied and pasted the solution from a very old thread.Loïc wrote:Something like this should do the trick:
Code: Select all
Dim hBitmap As Long = oGdPictureImaging.GetHBitmap(ImageID) Set Picture1.Image = imgTest.FromHbitmap(hBitmap)
At any rate, if someone else is having the same question, I've figured it out:
Assuming you already have a GDImage object as 'ImageID':
imgHeight = m_GdPictureImaging.GetHeight(ImageID)
imgWidth = m_GdPictureImaging.GetWidth(ImageID)
Set Me.Picture1.Picture = Nothing
Me.Picture1.Height = imgHeight
Me.Picture1.Width = imgWidth
m_GdPictureImaging.DrawGdPictureImageOnHDC ImageID, Me.Picture1.hdc, 0, 0, imgWidth, imgHeight, InterpolationMode_Default
Me.Picture1.Picture = Me.Picture1.Image
Who is online
Users browsing this forum: Bing [Bot] and 2 guests