Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

delphi cartoon drwaing

I need an application so:
1) It loads a JPEG or BMP at the background (easy part)
2) User can add some pre-defned shapes (as comic strip ballon above the background) and texts
3) User can move/edit/delete this baloons and edit texts as well
4) User can save the whole work in JPEG


Is there an avaible component to make this work ?

Best regards
0
yarek
Asked:
yarek
1 Solution
 
TheRealLokiSenior DeveloperCommented:
the only tricky part is placing the baloons/text on the image without blitzing the background.
This link shows you how to do that
http://www.delphiforfun.org/Programs/Delphi_Techniques/maskdrawing.htm

So, load the jpg, but convert it to bmp so you can work on it more easily (by using image1.pictures.bitmap.canvas)

Apart from that, keep an "original image" on file (and in memory while you work), and perhaps simply make a list of "changes done to the image"
an ini file for example

[change 1]
type=overlay image
overlay image filename=c:\temp\baloonshape1.jpg
x=100
y=100

[change 2]
type=text
x=120
y=120
text=hello
font=comic sans serif
font size=10
font color=$00FF00
font underline=0
font bold=1

...etc
basically 1 ini section per actual end result image/text that has been added.
as you move a baloon, update the ini file, and then "redraw the whole thing" 1 step at a time (the image and mask may still be in memory if you use that link i pasted above)

That's probably how I'd do it anyway
0
 
Slick812Commented:
hello yarek , ,  I can not tell much from your statements in your question about the complexity of your  " pre-defned shapes " or the pixel size of these, and other factors that would affect this kind of operation, , but if you do not need photographic image detail in your " pre-defned shapes ", I would think that Meta file images (delphi TMetafile) would be the best way to do this, you can also do text as a TMetafile, , with TMetafiles you will not need to do masking for transparent drawing. . .  Have you used the TMetafile ?
0
 
carolosfCommented:
the graphics 32 package is great for this :)
http://g32.org

"
Overview
Graphics32 is a set of functions, classes, components and controls designed for high-performance graphics programming.

Being highly specialized for 32-bit pixel format, it provides fast operations with pixels and graphic primitives and in most cases Graphics32 considerably outperforms standard TBitmap/TCanvas classes.

The library comes with a full source code, documentation and examples.
"
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now