Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8073259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:16:52+00:00 2026-06-05T14:16:52+00:00

I trying to build an app which combines a background image with text bubbles

  • 0

I trying to build an app which combines a background image with text bubbles on top of it. I have text bubbles initialized as stretchable UIImages with leftCapWidth and topCapHeight defined. While displaying the text bubbles in the app itself everything works fine and the text bubbles are displayed normally without any lines drawn on top of them.

However when I try to export the images, I combine the background image with text bubbles on top using the UIGraphicsBeginImageContext() function I see that the text bubbles have a vertical line and a horizontal line drawn on them. They seem to be drawn at the point defined by the leftCapWidth and topCapHeight. Anyone faced such an issue before?

The only difference I see in rendering the image in my app and exporting it is that I use UIImageViews to hold the stretchable images while exporting I am just using UIImages.

Code for combining a bubble image to a background image:

UIGraphicsBeginImageContext(mainImage.size);

[fullSectionImage drawInRect:CGRectMake(0, 0, mainImage.size.width, mainImage.size.height) blendMode:kCGBlendModeNormal alpha:1.0 ];

UIImage *bubbleImage = [UIImage imageNamed:@"bubble1.png"];
stretchableImage = [bubbleImage stretchableImageWithLeftCapWidth:40 topCapHeight:15];
[stretchableImage drawInRect:CGRectMake(originX,originY,width,height) blendMode: kCGBlendModeNormal alpha:1.0 ];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();   
UIImageWriteToSavedPhotosAlbum(newImage, nil,nil,nil);

Code for displaying the same bubble with the background image in the app:

UIImageView *bubbleImageView;
UIImage *bubbleImage = [UIImage imageNamed:@"bubble1.png"];
stretchableImage = [bubbleImage stretchableImageWithLeftCapWidth:40 topCapHeight:15];
bubbleImageView = [[UIImageView alloc] initWithImage:stretchableImage];
[bubbleImageView setFrame:CGRectMake(0,0,width,height)];
bubbleImageView.autoresizingMask = YES;
[self addSubview:bubbleImageView];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:16:54+00:00Added an answer on June 5, 2026 at 2:16 pm

    In order to solve this issue the stretchableImage should use drawInRect method with all integer values as arguements.

    [stretchableImage drawInRect:CGRectMake(originX,originY,width,height) blendMode: kCGBlendModeNormal alpha:1.0 ];
    

    originX, originY, width, height need to be integer values in this case. This solved the issue for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build an app which will have a bunch of cards
I'm trying to build an app, which should have Flash Player control, which plays
I have a situation where I'm trying to build a web app which takes
I am trying to build an app which has lot of content to be
I am trying to build an app in which I want to trigger a
I'm trying to build an app where I have a TabBarController with 4 entries.
I am trying to build an App which is swapping its fragments by interactions
I'm trying to build a small app which allows downloading of multiple files at
Hey i'm trying to build an app in which the user can input some
All, I am trying to build a completely UTF-8 web app which allows users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.