Need help with LeadTools API and displaying image in image control 
Author Message
 Need help with LeadTools API and displaying image in image control
As the subject states I have problems displaying a jpg image using the
LeadTools API. Have anyone experience with this?
I believed it was as simple as this:
    ! get the handle to the control
    hCtrl=ctrl{prop:handle})

    ! get the device context to the control
    hCtrlDC=GetDC(hCtrl)

    ! get file info with LeadTools
    L_FileInfo(...

    ! load image into LeadTools bitmap
    L_LoadFile(...

    ! display image on DC
    L_PaintDC(...

    ! release DC
    ReleaseDC(hCtrl,hCtrlDC)

 Obviously it is not as simple as I initially thougth since I don't get
anything in the control. Is it necessary to somehow get the image into the
BLOB associated with the imagecontrol? Or is there any other clever way of
doing this? Or am I simply overlooking something very fundamental?

Regards,
Asle Aursand



Fri, 03 May 2002 03:00:00 GMT  
 Need help with LeadTools API and displaying image in image control
Asle,
As I see from the procedures that you describe you are you are using
the LeadTools dll. You normally display the image directly onto the
window without the use of an image control.
And yes it is more complicated that the LeadTools manual describes.
Take also in consideration that Clarion doesn't know when Leadtools
have written your image to screen. That means that if your window
with the image is being overlapped by another window the image
disappears and you have to detect that and have a repaint routine
or procedure to restore the display.
You may for that matter consider the use of the LeadTools OCX.
Here is a bit of code that I used to get the image to display
on a Clarion window. I hope that it may help!
Regards,
Marius Luidens

     Initialization after opening window
      windowhandle = window{prop:handle}
      Hdc = CreateDC('DISPLAY',0,0,0)
      hOurPalette = L_CreatePaintPalette(hdc,address(BitmapStructure))
      hSavedPalette = SelectPalette(hdc,hOurPalette,0)
      junk# = RealizePalette(hdc)
      junk# =
SetRect(address(Rect1),imageleft,imagetop,imageright,imagebottom)
       InvalidateRect(windowhandle,0,0)  !Force a Repaint

       Load the Picture File
       junk# = L_FreeBitmap(address(BitmapStructure))
       filename3 = 'test.jpg'
       junk# = L_LoadBitmap(Filename3,address(BitmapStructure), 0,1)
       junk# =
L_PaintDC(hdc,address(BitmapStructure),0,0,ImageRect,0,00CC0020h)
       junk# = ReleaseDC(windowhandle,hdc)

Quote:

> As the subject states I have problems displaying a jpg image using the
> LeadTools API. Have anyone experience with this?
> I believed it was as simple as this:
>     ! get the handle to the control
>     hCtrl=ctrl{prop:handle})

>     ! get the device context to the control
>     hCtrlDC=GetDC(hCtrl)

>     ! get file info with LeadTools
>     L_FileInfo(...

>     ! load image into LeadTools bitmap
>     L_LoadFile(...

>     ! display image on DC
>     L_PaintDC(...

>     ! release DC
>     ReleaseDC(hCtrl,hCtrlDC)

>  Obviously it is not as simple as I initially thougth since I don't get
> anything in the control. Is it necessary to somehow get the image into the
> BLOB associated with the imagecontrol? Or is there any other clever way of
> doing this? Or am I simply overlooking something very fundamental?

> Regards,
> Asle Aursand



Fri, 03 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. displaying an Image using PIL w/o Image.show

2. Colormap problems (Image display, Image fromUser)

3. Image Display program for nuclear medicine images.

4. How retrieve original Image size from Image control.

5. Controlling image display duration

6. import Image vs from PIL import Image vs import PIL.Image

7. Need to print bar codes and print/display images from Clipper

8. Help-How to Display a BitMap Image on a Report (Digitalk RW)

9. Help Image Displays

10. HELP (Image Display)

11. Help with image display

 

 
Powered by phpBB® Forum Software