DrawTiledImage(ImageID, X, Y, Width, Height)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

A better request would be ClipDrawing() or something. It will make coding a procedure like this much easier and also have other uses.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

How would it work? What other uses would it have?
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Post by wilbert »

It would make more sense to me in this case if all 2d drawing functions would support the ability to use a texture as a fill. That way you could simply draw a box and use your image as a texture. But with this kind of a more general feature you would also be able to use it for circles and ellipses.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

those are called "pattern" not "texture".
is this still avaliable on modern systems?
oh... and have a nice day.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Post by wilbert »

You are right it is called a pattern. I mentioned it wrong.
I don't know if there are api functions like this. I use ActionScript quite a lot for Flash movies and that language has a nice function called BeginBitmapFill that accepts a bitmap and a transform matrix to rotate, scale and translate this bitmap fill.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

They are called "brushes" in Windows API.
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Post by Seymour Clufley »

I think this is a good idea for a feature request.

Code: Select all

tileimg = LoadImage(#PB_Any,"a_file.bmp")
DrawingMode(#PB_2DDrawing_Texture)
DrawingTextureImage(ImageID(tileimg))
Ellipse(50,50,200,100)
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Post Reply