Announcement

Collapse
No announcement yet.

Rendering bitmaps in ellipses

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael Mattias
    replied
    >I'm not familiar with the Win32 instructions



    (Reading the WinAPI documentation IS a skill you WILL need to master, so you may as well start now).

    Leave a comment:


  • Frank Kestens
    replied
    Originally posted by Chris Boss View Post
    BitBlt and TransparentBlt should be defined in the win32api.inc file.
    Thanks .
    I'm not familiar with the Win32 instructions .
    How might the code be , given a bitmap$ ?

    Leave a comment:


  • Chris Boss
    replied
    BitBlt and TransparentBlt should be defined in the win32api.inc file.

    Leave a comment:


  • Frank Kestens
    replied
    Originally posted by Chris Boss View Post
    There are different ways to accomplish this.

    One is to use the TransparentBlt API function to draw the bitmap. You will need to create a memory DC, select the bitmap into that DC and then use this function to do a transparent Blt from the memory DC to the Graphic control.

    A second technique for images which have a fixed shaped, like a circle or ellipse, is to select a clipping region into the graphic controls DC which only allows the part of the image you want to be drawn and then BitBlt the image like usual. Windows will clip the rest of the image out. You can create a circular region using CreateEllipticRgn and then select it into a DC using SelectObject to define a clipping region.
    Thanks for the prompt answer !
    I guess to do so I need BitBlt.inc , right ? Where can I find this ?

    Leave a comment:


  • Chris Boss
    replied
    There are different ways to accomplish this.

    One is to use the TransparentBlt API function to draw the bitmap. You will need to create a memory DC, select the bitmap into that DC and then use this function to do a transparent Blt from the memory DC to the Graphic control.

    A second technique for images which have a fixed shaped, like a circle or ellipse, is to select a clipping region into the graphic controls DC which only allows the part of the image you want to be drawn and then BitBlt the image like usual. Windows will clip the rest of the image out. You can create a circular region using CreateEllipticRgn and then select it into a DC using SelectObject to define a clipping region.

    Leave a comment:


  • Frank Kestens
    started a topic Rendering bitmaps in ellipses

    Rendering bitmaps in ellipses

    For astronomical purposes ( I have written a fair good gravity integrator in Powerbasic) i want to use pictures op planets to fill in ellipses .
    This works quite well till now as I use the "GRAPHIC RENDER Bitmap$" command . However the planets are represented as a square till now .
    Any Idea how I can fit and draw the planets picture in its ellipse ?
    Some of the Win32Api. may apply .
    To give some idea about the programs performance you can visit the www.orbitsimulator.com site .
    Many thanks . Frank Kestens.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎