Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Problem with project.

  • 19-02-2004 09:20AM
    #1
    Moderators, Computer Games Moderators Posts: 4,570 Mod ✭✭✭✭


    Trying to write some code for C++ Builder 4.

    I'm trying to dynamically create images for this GUI for a game editor.

    The problem at the moment is how do I create an image from nothing?

    I can use an image dialog box to choose a file for the desired location, however how do I display that on the screen?

    Any help would be greatly appreciated.

    This is what I have at the moment (I'm using the standard shapes at the moment till I can figure this out)


    void __fastcall TfrmMain::imgMainInterfaceMouseDown(TObject *Sender,
    TMouseButton Button, TShiftState Shift, int X, int Y)
    {
    if (Drawing == True)
    {
    imgMainInterface->Canvas->Rectangle(X, Y, X + 10, Y + 10);
    Drawing = false;
    txtObjectXCoord->Text = X;
    txtObjectYCoord->Text = Y;
    }
    }

    txtObjectXCoord is a text box which displays the X co-ordinates, ditto for txtObjectYCoord.

    Is it possible to copy an image from a file to the C++ window?
    I cant find anything in the help files but then they are pretty ****e (on various occasions they seem to be help files for Delphi).
    Any website links or anything would be awesome either


Advertisement