473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Centre Bitmap in another one!?

24
I have a small bitmap, and I want to place it in the centre (horizontally and vertically) of another Bitmap object. (i.e. replace the pixels)

how can this be done?
Apr 21 '07 #1
5 1254
Frinavale
9,735 Expert Mod 8TB
I have a small bitmap, and I want to place it in the centre (horizontally and vertically) of another Bitmap object. (i.e. replace the pixels)

how can this be done?
What language are you using?
Apr 21 '07 #2
Guy007
24
i'm using c#
Apr 21 '07 #3
Frinavale
9,735 Expert Mod 8TB
i'm using c#

I'm not sure if this is possible.
You could try putting the bottom picture as a background in a <div id="bottom"> and then putting the upper picture in a <div id="top">. You could then put the <div id="top"> inside the <div id="bottom> and center the top one within it.
I don't know if this is going to work but its worth a try :)

-Frinny
Apr 23 '07 #4
Plater
7,872 Expert 4TB
You said bitmap object right?

try something like this: (I am winging it so there might be typos)

Graphics g=Graphics.CreateFromImage(mybiggerbitmap);
g.DrawImageUnscaled(mysmallerbitmap, x,y);


bitmap objects have the .height and .width properties so you can do some quick math to determine what x and y will be to draw the image on top of the other.
Apr 23 '07 #5
Motoma
3,237 Expert 2GB
Thanks for the response Plater!
Apr 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sharon | last post by:
I have 2 questions that are just the opposite to one another: (1) I need to read an image file (like bitmap, jpeg etc.) and to save only its data, I need to save his data in a raw data format,...
7
by: Dennis | last post by:
I am trying to implement drawing on a bitmap and using bitblt to transfer it to the control graphics object in the paint event. It seems to draw on the bitmap ok but doesn't get transferred to the...
7
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
0
by: AlVis1515 | last post by:
We had a VB6 program that was used to take a scanned signature image as a set of screen coordinates. The VB6 program then converted this into a bitmap file which we used to embed the signature...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.