Show and edit transparent background text over an picturebox image

Answered Show and edit transparent background text over an picturebox image

  • Saturday, August 18, 2012 11:23 AM
     
     

     Hello, I need your help please:

    I have picturebox, the back ground of this picturebox is bitmap image "floorplan image", I need to show a text over this image with transparent backcolor , "I think textbox hasn't this property" and the customer can edit this text  (by clicking on it and edit the text) at run time.

    and these changes to the text must be kept "saved" at next run time.

    Thank you for your help.

    public partial class Form1 : Form
        {

    PictureBox pictureBoxMap = new PictureBox();

    public Form1()
            {

     InitializeComponent();

    Bitmap image1 = new Bitmap(@"D:\New Folder1\Map.png");

    pictureBoxMap.Image = (Image)image1;

    this.Controls.Add(pictureBoxMap);

All Replies

  • Saturday, August 18, 2012 11:31 AM
     
     
    Hello, I need your help please:

    I have picturebox, the back ground of this picturebox is bitmap image "floorplan image", I need to show a text over this image with transparent backcolor , "I think textbox hasn't this property" and the customer can edit this text  (by clicking on it and edit the text) at run time.

    and these changes to the text must be kept "saved" at next run time.

    Thank you for your help.

    public partial class Form1 : Form
        {

    PictureBox pictureBoxMap = new PictureBox();

    public Form1()
            {

     InitializeComponent();

    Bitmap image1 = new Bitmap(@"D:\New Folder1\Map.png");

    pictureBoxMap.Image = (Image)image1;

    this.Controls.Add(pictureBoxMap);


    Yaman

  • Saturday, August 18, 2012 1:26 PM
     
     
  • Monday, August 20, 2012 6:25 AM
    Moderator
     
     

    Hi yamanneameh,

    It seems that you would like to create a transparent textbox over the picturebox. As far as I know, the textbox doesn't support transparent backcolor by default. But here is an article about how to set alpha blend with textbox.

    http://www.codeproject.com/Articles/4390/AlphaBlendTextBox-A-transparent-translucent-textbo

    If you want to save the text, you may try to save it in a config file or use settings.settings.

    http://msdn.microsoft.com/en-us/library/aa730869(v=VS.80).aspx

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Monday, August 20, 2012 2:51 PM
     
     Answered

    I tried AlphaBlend dll file but it didnt work well, so what I did is I took the exact color of my pictureboxand make the txtbox with the same backcolor

    txtRoomNames[i].BackColor = Color.FromArgb(31, 32, 49);

    and to change textbox texts & save this text for the next runtime I did it in this link:

    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/f4f6929c-b27b-4246-9947-70a8f18ce68f


    Yaman

  • Tuesday, August 21, 2012 9:23 AM
    Moderator
     
     

    Hi yamanneameh,

    I'm glad to hear that you found the solution.

    Thanks for sharing it.

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.